Sort yml items to get same results for regendoc runs
This commit is contained in:
parent
a6b2732507
commit
eed21e06db
|
@ -10,7 +10,7 @@ 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.safe_load(self.fspath.open())
|
raw = yaml.safe_load(self.fspath.open())
|
||||||
for name, spec in raw.items():
|
for name, spec in sorted(raw.items()):
|
||||||
yield YamlItem(name, self, spec)
|
yield YamlItem(name, self, spec)
|
||||||
|
|
||||||
class YamlItem(pytest.Item):
|
class YamlItem(pytest.Item):
|
||||||
|
@ -19,7 +19,7 @@ class YamlItem(pytest.Item):
|
||||||
self.spec = spec
|
self.spec = spec
|
||||||
|
|
||||||
def runtest(self):
|
def runtest(self):
|
||||||
for name, value in self.spec.items():
|
for name, value in sorted(self.spec.items()):
|
||||||
# some custom test execution (dumb example follows)
|
# some custom test execution (dumb example follows)
|
||||||
if name != value:
|
if name != value:
|
||||||
raise YamlException(self, name, value)
|
raise YamlException(self, name, value)
|
||||||
|
|
Loading…
Reference in New Issue