internally use pytest.* instead of `py.test.*` in many places.

make sub namespace names 'collect' and 'cmdline' available on pytest directly
This commit is contained in:
holger krekel
2010-11-13 09:05:11 +01:00
parent 323dd8a25a
commit 2e4e9eb745
23 changed files with 175 additions and 156 deletions

View File

@@ -6,14 +6,14 @@ def pytest_collect_file(path, parent):
if path.ext == ".yml" and path.basename.startswith("test"):
return YamlFile(path, parent)
class YamlFile(py.test.collect.File):
class YamlFile(pytest.File):
def collect(self):
import yaml # we need a yaml parser, e.g. PyYAML
raw = yaml.load(self.fspath.open())
for name, spec in raw.items():
yield YamlItem(name, self, spec)
class YamlItem(py.test.collect.Item):
class YamlItem(pytest.Item):
def __init__(self, name, parent, spec):
super(YamlItem, self).__init__(name, parent)
self.spec = spec