Skip to content

Commit

Permalink
Merge branch 'master' into enh/admonitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau authored Mar 21, 2024
2 parents 223deae + 6d13c80 commit eb522c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: check-added-large-files
- id: check-case-conflict
- repo: https://github.com/psf/black
rev: 24.2.0
rev: 24.3.0
hooks:
- id: black
files: ^tools/(?!schemacode)
Expand Down
2 changes: 1 addition & 1 deletion src/schema/SCHEMA_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.3-dev
0.8.1-dev
11 changes: 3 additions & 8 deletions tools/schemacode/bidsschematools/data/tests/test_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ def _dict_key_lookup(_dict, key, path=[]):
@pytest.mark.validate_schema
def test_rule_objects(schema_obj):
"""Ensure that all objects referenced in the schema rules are defined in
its object portion.
their object portion.
This test currently fails because rules files reference object keys for some object types,
including entities, columns, and metadata fields,
but reference "name" or "value" elements of the object definitions for other object types,
including suffixes and extensions.
In the case of datatypes, the key and "value" field are always the same.
Some other object types, such as associated_data, common_principles, formats, modalities,
Expand Down Expand Up @@ -83,8 +79,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 +95,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}")


@pytest.mark.validate_schema
Expand Down

0 comments on commit eb522c6

Please sign in to comment.