-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Remove excess test data from bidsschematools installation dire…
…ctories (#1985) * chore: Move bidsschematools to src-layout * chore: Update locations in .pre-commit-config.yaml * chore: Ignore tests/data/bids*-examples * test: Save test data into tests/data * chore: Update package data discovery * chore(ci): Make sure schemacode tests are triggered on maintenance branches * chore(ci): Update pytest invocation * chore: Ensure coverage is collected from tests and installed modules
- Loading branch information
Showing
39 changed files
with
86 additions
and
78 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
recursive-include tests * |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
tools/schemacode/bidsschematools/tests/test_make_testdata.py
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
File renamed without changes.
File renamed without changes.
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../src/metaschema.json |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../src/schema |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
38 changes: 38 additions & 0 deletions
38
tools/schemacode/src/bidsschematools/tests/test_make_testdata.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import os | ||
import shutil | ||
|
||
import pytest | ||
|
||
|
||
def require_env(var): | ||
env = os.environ.get(var) | ||
return pytest.mark.skipif( | ||
not env, reason=f"To activate this test/feature `export {var}=1` and re-run." | ||
) | ||
|
||
|
||
@require_env("BIDSSCHEMATOOLS_RELEASE") | ||
def test_make_archive(tests_data_dir, bids_examples, bids_error_examples): | ||
""" | ||
ATTENTION! This is not a test! | ||
Create static testdata archive containing the bidsschematools data reference whitelist. | ||
Notes | ||
----- | ||
Due to intricacies arising from: | ||
(1) fixtures not working outside of pytest | ||
(2) implicit teardown leveraging tempdata removal (while held open by yield) | ||
(3) wrappers evaluating the yield statement | ||
(4) the desire to not download testdata twice for archive creation | ||
testdata archive creation is now inconspicuously posing as a test. | ||
""" | ||
|
||
ignore_git = shutil.ignore_patterns(".git*") | ||
target_examples = tests_data_dir / "bids-examples" | ||
target_error_examples = tests_data_dir / "bids-error-examples" | ||
if bids_examples != target_examples: | ||
shutil.copytree(bids_examples, target_examples, ignore=ignore_git) | ||
if bids_error_examples != target_error_examples: | ||
shutil.copytree(bids_error_examples, target_error_examples, ignore=ignore_git) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bids*-examples |