added new unittests#109
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands unit test coverage across several TPTBox core modules (vertebra constants, NumPy utilities, and NII I/O / morphology) and cleans up some boilerplate (sys.path hacks, duplicate imports) in existing test files. It also adds a pytest.ini_options section to silence deprecation/future warnings and refines the coverage exclude patterns.
Changes:
- Add new test classes covering
Vertebra_Instanceregion accessors, navigation helpers,Locationenum, andvert_subreg_labels. - Add new test classes covering many
np_utilsfunctions (bbox, point coords, translate-to-center, convex hull, Betti numbers, majority label overlap, top-k indices) and NII I/O + morphology (erode_msk,dilate_msk,fill_holes,get_seg_array,from_numpy, save/load round-trip). - Remove
sys.pathmanipulation and redundant imports from existing test files; configure pytest warning filters and tighten coverage exclude regex patterns inpyproject.toml.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| unit_tests/test_vertconstants.py | Drops sys.path boilerplate; adds tests for region accessors, navigation helpers, and Location enum. |
| unit_tests/test_nputils.py | Removes sys.path/noqa boilerplate from import block. |
| unit_tests/test_nputils_extended.py | Adds tests for bbox, point coords, translate-to-center, convex hull, Betti numbers, majority label overlap, top-k. |
| unit_tests/test_nii.py | Removes unused sys/Path imports and a duplicate nibabel import inside a method. |
| unit_tests/test_nii_io.py | New file: save/load round-trip and from_numpy factory tests. |
| unit_tests/test_nii_extended.py | Adds tests for erode_msk/dilate_msk, fill_holes, and get_seg_array. |
| pyproject.toml | Adds pytest warning filters; refines coverage exclude patterns. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
increase code coverage by adding lots of new unittests