Make configfiles.YamlConfig iteration deterministic
This commit is contained in:
parent
42550cd2e6
commit
208b4d1cbc
@ -109,7 +109,7 @@ class YamlConfig(QObject):
|
|||||||
return name in self._values
|
return name in self._values
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
return iter(self._values.items())
|
return iter(sorted(self._values.items()))
|
||||||
|
|
||||||
def _mark_changed(self):
|
def _mark_changed(self):
|
||||||
"""Mark the YAML config as changed."""
|
"""Mark the YAML config as changed."""
|
||||||
|
@ -161,7 +161,7 @@ class TestYaml:
|
|||||||
def test_iter(self, yaml):
|
def test_iter(self, yaml):
|
||||||
yaml['foo'] = 23
|
yaml['foo'] = 23
|
||||||
yaml['bar'] = 42
|
yaml['bar'] = 42
|
||||||
assert list(iter(yaml)) == [('foo', 23), ('bar', 42)]
|
assert list(iter(yaml)) == [('bar', 42), ('foo', 23)]
|
||||||
|
|
||||||
@pytest.mark.parametrize('old_config', [
|
@pytest.mark.parametrize('old_config', [
|
||||||
None,
|
None,
|
||||||
|
Loading…
Reference in New Issue
Block a user