Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: cms/tests/dynamic_tests/conftest.py

Issue 29345468: Issue 4045 - Add Test Suite To CMS (Closed)
Patch Set: CMS Test Suite Conf and Some Tests Created June 29, 2016, 1:13 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cms/sources.py ('k') | cms/tests/dynamic_tests/test_dynamic.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 import os
2 import pytest
3
4 SOURCEPATH = 'cms/tests/test_site/pages/'
5
6
7 @pytest.fixture(scope='session', autouse=True)
8 def dynamic_session_setup(request):
9 seen = set()
10 session = request.node
11 for item in session.items:
12 cls = item.getparent(pytest.Class)
13 if cls not in seen:
14 if hasattr(cls.obj, 'run_test_server'):
15 p = cls.obj.run_test_server()
16 seen.add(cls)
17
18 def dynamic_tear_down():
19 p.terminate()
20 request.addfinalizer(dynamic_tear_down)
21
22
23 @pytest.fixture(scope='session')
24 def get_pages():
25 return_data = set()
26 print os.walk(SOURCEPATH)
27 for (dirpath, dirnames, filenames) in os.walk(SOURCEPATH):
28 for input_file in filenames:
29 return_data.add(input_file)
30 return return_data
OLDNEW
« no previous file with comments | « cms/sources.py ('k') | cms/tests/dynamic_tests/test_dynamic.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld