diff options
author | Ghostkeeper <rubend@tutanota.com> | 2019-11-04 13:46:11 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2019-11-04 13:50:57 +0300 |
commit | c7c6389897eec1efa70185afec5096ff6b38879c (patch) | |
tree | 9cf4a6b03644d7c5da0ad1e1808296999c76d3fc /tests/Settings | |
parent | aa5b788b5923b8b3d884d75d88022f28dbb78ba3 (diff) |
Report on all faulty keys at once instead of crashing on first
This makes it a lot easier to communicate back to users what is going wrong.
Diffstat (limited to 'tests/Settings')
-rw-r--r-- | tests/Settings/TestDefinitionContainer.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/Settings/TestDefinitionContainer.py b/tests/Settings/TestDefinitionContainer.py index 4487388b86..9e8e967692 100644 --- a/tests/Settings/TestDefinitionContainer.py +++ b/tests/Settings/TestDefinitionContainer.py @@ -70,9 +70,12 @@ def test_validateOverridingDefaultValue(file_path: str): if "overrides" not in doc: return # No settings are being overridden. No need to check anything. parent_settings = getInheritedSettings(doc["inherits"]) + faulty_keys = set() for key, val in doc["overrides"].items(): if key in parent_settings and "value" in parent_settings[key]: - assert "default_value" not in val, "Unnecessary default_value for {key} in {file_name}".format(key = key, file_name = file_path) # If there is a value in the parent settings, then the default_value is not effective. + if "default_value" in val: + faulty_keys.add(key) + assert not faulty_keys, "Unnecessary default_values for {faulty_keys} in {file_name}".format(faulty_keys = sorted(faulty_keys), file_name = file_path) # If there is a value in the parent settings, then the default_value is not effective. ## Get all settings and their properties from a definition we're inheriting # from. |