Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SCHEMA] Very minor tune ups to the test_rule_objects test while trying to grasp its function #1728

Merged
merged 4 commits into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions tools/schemacode/bidsschematools/data/tests/test_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ def test_rule_objects(schema_obj):
if object_type in ["extensions", "suffixes"]:
# Some object types are referenced via their "value" fields in the rules
object_values = [
schema_obj["objects"][object_type][k]["value"]
for k in schema_obj["objects"][object_type].keys()
value["value"] for value in schema_obj["objects"][object_type].values()
]
else:
# But other object types are referenced via their keys
Expand All @@ -100,7 +99,7 @@ def test_rule_objects(schema_obj):

if not_found:
not_found_string = "\n".join([f"{'.'.join(path)} == {val}" for path, val in not_found])
raise ValueError(not_found_string)
raise AssertionError(f"Undefined objects found in rules: {not_found_string}")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could have sworn I have tested it -- must be some hand tremble removed it last moment ;)



@pytest.mark.validate_schema
Expand Down
Loading