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

Unified 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.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cms/sources.py ('k') | cms/tests/dynamic_tests/test_dynamic.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cms/tests/dynamic_tests/conftest.py
===================================================================
new file mode 100644
--- /dev/null
+++ b/cms/tests/dynamic_tests/conftest.py
@@ -0,0 +1,30 @@
+import os
+import pytest
+
+SOURCEPATH = 'cms/tests/test_site/pages/'
+
+
+@pytest.fixture(scope='session', autouse=True)
+def dynamic_session_setup(request):
+ seen = set()
+ session = request.node
+ for item in session.items:
+ cls = item.getparent(pytest.Class)
+ if cls not in seen:
+ if hasattr(cls.obj, 'run_test_server'):
+ p = cls.obj.run_test_server()
+ seen.add(cls)
+
+ def dynamic_tear_down():
+ p.terminate()
+ request.addfinalizer(dynamic_tear_down)
+
+
+@pytest.fixture(scope='session')
+def get_pages():
+ return_data = set()
+ print os.walk(SOURCEPATH)
+ for (dirpath, dirnames, filenames) in os.walk(SOURCEPATH):
+ for input_file in filenames:
+ return_data.add(input_file)
+ return return_data
« 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