refactor: split mask tests into granular focused tests#232
Merged
Conversation
Split monolithic test functions across both mask test files into individual focused tests, one assertion-group per test. Applied @pytest.mark.parametrize for is_all_true, is_all_false, shape_native_masked_pixels, resized_from, from_fits resized shape, is_circular, and circular_radius to eliminate repeated setup blocks. Changes per file: - test_mask_1d.py: 5 tests → 9 tests; constructor split into 3 scenarios; is_all_true and is_all_false each converted to parametrize (4 cases each) - test_mask_2d.py: 18 tests → 40 tests; constructor split into 2 scenarios; all_false split into normal/inverted; circular/annular/elliptical/ elliptical_annular each split into normal and invert=True variants; from_pixel_coordinates split into 3 cases by buffer; mask_centre split into 6 directional tests; shape_native_masked_pixels parametrized over 3 shapes; resized_from parametrized; is_circular/circular_radius parametrized Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
test_mask_1d.py: 5 tests → 9 tests.constructorsplit into 3 scenario-specific tests.is_all_trueandis_all_falseeach converted to@pytest.mark.parametrizecovering all 4 cases.test_mask_2d.py: 18 tests → 40 tests. Key changes:constructorsplit into scalar pixel scale vs anisotropic+originall_falsesplit into normal andinvert=Truevariantscircular,circular_annular,elliptical,elliptical_annulareach split into standard andinvert=Truetestsfrom_pixel_coordinatessplit into 3 tests (no buffer, buffer=1 single coord, buffer=1 two coords)mask_centresplit into 6 directional tests (symmetric, x-offset, y-offset, negative-x, negative-y, diagonal)shape_native_masked_pixelsparametrized over 3 mask shapesresized_fromparametrized over 2 target shapesis_circularparametrized;circular_radiusparametrizedTest plan
python -m pytest test_autoarray/mask/ -v— all tests should pass🤖 Generated with Claude Code