OLD | NEW |
(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 |
OLD | NEW |