Merged hpk42/pytest into default

This commit is contained in:
holger krekel 2013-05-17 11:32:52 +02:00
commit ed1095565b
2 changed files with 3 additions and 1 deletions

View File

@ -20,6 +20,8 @@ Changes between 2.3.5 and 2.4.DEV
- honor --tb style for setup/teardown errors as well. Thanks Maho. - honor --tb style for setup/teardown errors as well. Thanks Maho.
- fix issue307 - use yaml.safe_load in example, thanks Mark Eichin.
Changes between 2.3.4 and 2.3.5 Changes between 2.3.4 and 2.3.5
----------------------------------- -----------------------------------

View File

@ -9,7 +9,7 @@ def pytest_collect_file(parent, path):
class YamlFile(pytest.File): class YamlFile(pytest.File):
def collect(self): def collect(self):
import yaml # we need a yaml parser, e.g. PyYAML import yaml # we need a yaml parser, e.g. PyYAML
raw = yaml.load(self.fspath.open()) raw = yaml.safe_load(self.fspath.open())
for name, spec in raw.items(): for name, spec in raw.items():
yield YamlItem(name, self, spec) yield YamlItem(name, self, spec)