Mercurial > piecrust2
comparison tests/conftest.py @ 397:879b6b5647a8
tests: Move all bakes/cli/servings tests files to have a YAML extension.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 18 May 2015 15:48:45 -0700 |
parents | 3e4bb57d8506 |
children | af17c143b9ab |
comparison
equal
deleted
inserted
replaced
396:dc0988d937b3 | 397:879b6b5647a8 |
---|---|
27 logging.getLogger('piecrust').addHandler(hdl) | 27 logging.getLogger('piecrust').addHandler(hdl) |
28 logging.getLogger('piecrust').setLevel(logging.DEBUG) | 28 logging.getLogger('piecrust').setLevel(logging.DEBUG) |
29 | 29 |
30 | 30 |
31 def pytest_collect_file(parent, path): | 31 def pytest_collect_file(parent, path): |
32 if path.basename.startswith("test"): | 32 if path.ext == '.yaml' and path.basename.startswith("test"): |
33 if path.ext == ".bake": | 33 category = os.path.basename(path.dirname) |
34 if category == 'bakes': | |
34 return BakeTestFile(path, parent) | 35 return BakeTestFile(path, parent) |
35 elif path.ext == ".chef": | 36 elif category == 'cli': |
36 return ChefTestFile(path, parent) | 37 return ChefTestFile(path, parent) |
37 elif path.ext == ".serve": | 38 elif category == 'servings': |
38 return ServeTestFile(path, parent) | 39 return ServeTestFile(path, parent) |
39 | 40 |
40 | 41 |
41 class YamlTestFileBase(pytest.File): | 42 class YamlTestFileBase(pytest.File): |
42 def collect(self): | 43 def collect(self): |