diff --git a/tests/unit/config/test_configtypes.py b/tests/unit/config/test_configtypes.py index 4756e657d..cafaffb98 100644 --- a/tests/unit/config/test_configtypes.py +++ b/tests/unit/config/test_configtypes.py @@ -1471,10 +1471,13 @@ class TestDict: try: converted = d.from_str(text) except configexc.ValidationError: - pass - else: - expected = '' if not val else text - assert d.to_str(converted) == expected + return + + if len(converted) > 1: + # For longer dicts, the key order could be switched + return + + assert d.to_str(converted) == '' if not val else text def unrequired_class(**kwargs):