Make configfiles.YamlConfig iteration deterministic

This commit is contained in:
Florian Bruhin 2017-10-04 08:47:10 +02:00
parent 42550cd2e6
commit 208b4d1cbc
2 changed files with 2 additions and 2 deletions

View File

@ -109,7 +109,7 @@ class YamlConfig(QObject):
return name in self._values
def __iter__(self):
return iter(self._values.items())
return iter(sorted(self._values.items()))
def _mark_changed(self):
"""Mark the YAML config as changed."""

View File

@ -161,7 +161,7 @@ class TestYaml:
def test_iter(self, yaml):
yaml['foo'] = 23
yaml['bar'] = 42
assert list(iter(yaml)) == [('foo', 23), ('bar', 42)]
assert list(iter(yaml)) == [('bar', 42), ('foo', 23)]
@pytest.mark.parametrize('old_config', [
None,