Repository navigation
Load released test schemas from the bundle - #1476
Merged
Merged
Conversation
Tests loaded released standard schemas from seven copies under tests/data. They now use load_schema_version (the bundled copies in hed/schema/schema_data), and tests that name a standard inside an xml_folder build a temporary folder from their fixtures plus the bundled files (make_xml_folder in tests/schema/schema_test_helpers.py). - Delete HED8.0.0t.xml, HED8.1.0.xml, HED8.2.0.xml, HED8.2.0.mediawiki, merge_tests/HED8.2.0.xml and merge_group_tests/HED8.4.0.xml and HED8.5.0.xml; their differences from the releases were accidental. - TestHedBase gains a schema_version attribute; a schema_file still wins. - Remove existence guards that would have skipped tests silently, and dead references to the deleted files. - Add tests/data/schema_tests/README.md listing the edited fixtures kept.
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Schema substitutions affect many test suites, and their full results remain unverified.
No open issues 🎉
What changed in this PR
This PR consolidates released-schema test data around the schemas bundled with hedtools, reducing duplicate fixtures while retaining deliberately edited schemas.
Changes:
- Replace fixture-based loads with version-based loading across validator, model, analysis, and schema tests.
- Add bundled-file and temporary-folder helpers, plus
schema_versionsupport in the shared validator test base. - Remove obsolete fixtures, unused references, and selected existence guards; document retained test data.
| File | Description |
|---|---|
| tests/validator/test_tag_validator.py | Selects released schema 8.2.0. |
| tests/validator/test_tag_validator_library.py | Uses version-based loads for duplicate-schema checks. |
| tests/validator/test_tag_validator_base.py | Adds version loading while preserving file precedence. |
| tests/validator/test_spreadsheet_validator.py | Loads released schema 8.0.0. |
| tests/validator/test_sidecar_validator.py | Loads released schema 8.0.0. |
| tests/validator/test_onset_validator.py | Loads released schema 8.2.0. |
| tests/validator/test_hed_validator.py | Replaces fixture loads with released versions. |
| tests/validator/test_def_validator.py | Uses released schemas for definition tests. |
| tests/tools/analysis/test_hed_tag_counts.py | Uses released schema for tag counting. |
| tests/tools/analysis/test_assembling_hed_strings.py | Uses released schema for annotation assembly. |
| tests/tools/analysis/test_annotation_util.py | Uses released schema for annotation utilities. |
| tests/test_deprecations.py | Uses a bundled file for warning checks. |
| tests/scripts/test_script_util.py | Validates the bundled XML schema. |
| tests/schema/test_schema_util.py | Removes an unused fixture reference. |
| tests/schema/test_schema_merge.py | Builds temporary folders with bundled partner schemas. |
| tests/schema/test_schema_format_roundtrip.py | Uses released schemas and removes existence guards. |
| tests/schema/test_schema_compliance.py | Checks compliance against released 8.0.0. |
| tests/schema/test_hed_schema.py | Uses bundled data and removes unused setup. |
| tests/schema/test_hed_schema_io.py | Uses bundled XML and temporary prerelease fixtures. |
| tests/schema/test_convert_tags.py | Selects schema by version. |
| tests/schema/test_base_tag.py | Loads the configured schema version. |
| tests/schema/schema_test_helpers.py | Adds bundled-path and temporary-folder helpers. |
| tests/models/test_tabular_input.py | Uses released schema for tabular input. |
| tests/models/test_string_search.py | Uses released schema for ancestor searches. |
| tests/models/test_spreadsheet_input.py | Uses released schema for spreadsheet input. |
| tests/models/test_sidecar.py | Uses released schema for sidecar tests. |
| tests/models/test_schema_lookup.py | Uses released schema for lookup tests. |
| tests/models/test_query_util.py | Uses released schema for query utilities. |
| tests/models/test_query_service.py | Uses released schema for query services. |
| tests/models/test_query_handler.py | Uses released schema for query handling. |
| tests/models/test_hed_group.py | Uses released schema for group tests. |
| tests/models/test_column_mapper.py | Replaces fixture-path setup with version loading. |
| tests/models/test_base_input.py | Uses released schema for base input. |
| tests/data/schema_tests/README.md | Documents bundled loading and retained edited fixtures. |
| tests/data/schema_tests/merge_group_tests/README.md | Documents temporary partner-schema assembly. |
| tests/data/schema_tests/HED8.2.0.mediawiki | Deletes the redundant schema fixture. |
| spec_tests/test_hed_cache.py | Removes an unused fixture filename. |
Review effort: Balanced
…o cleanup_dup_tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests loaded released standard schemas from seven copies under tests/data. They now use load_schema_version (the bundled copies in hed/schema/schema_data), and tests that name a standard inside an xml_folder build a temporary folder from their fixtures plus the bundled files (make_xml_folder in tests/schema/schema_test_helpers.py).