refactor: split structures tests into granular focused tests#231
Merged
refactor: split structures tests into granular focused tests#231
Conversation
Split monolithic test functions in the arrays and grids test files into individual focused tests. Each test now has a name that encodes the input condition and expected outcome, so failures identify the exact scenario. Applied @pytest.mark.parametrize where the same logic runs over multiple equivalent inputs (resize shapes, kernel sizes for pad/trim). Changes per file: - test_uniform_1d.py (arrays): 8 tests → 14 tests; from_fits and header tests split by file size; recursive_shape_storage split by mask presence - test_uniform_2d.py (arrays): 17 tests → 33 tests; constructor split into 4 cases; resized_from parametrized over 2 shapes; padded/trimmed_from parametrized over kernel sizes; binned and brightest tests split by scenario - test_uniform_1d.py (grids): 8 tests → 12 tests; constructor, no_mask, from_mask, uniform, uniform_from_zero, and grid_2d_radial split - test_uniform_2d.py (grids): 21 tests → 24 tests; constructor exception split into too-many/too-few; no_mask and uniform split by scenario; bounding_box tests split with/without buffer variant 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_uniform_1d.py(arrays): 8 tests → 14 tests.from_fitssplit by file size (3-element vs 4-element); header info tests split;recursive_shape_storagesplit by no-mask vs partial-mask.test_uniform_2d.py(arrays): 17 tests → 33 tests.constructorsplit into 4 scenarios (all-false mask, partial mask 1D values, partial mask 2D values, store_native=True).resized_fromparametrized over 2 target shapes.padded_before_convolution_fromandtrimmed_after_convolution_fromparametrized over kernel sizes, with the larger-array variant as a separate test.binned_across_rows/columnssplit into 3 tests each.brightest_coordinatesplit into 4 tests.test_uniform_1d.py(grids): 8 tests → 12 tests. Constructor, no_mask, from_mask, uniform, uniform_from_zero all split by scenario.test_uniform_2d.py(grids): 21 tests → 24 tests. Constructor exception split into too-many/too-few cases.no_masksplit by origin.uniformsplit into 3 scenarios.bounding_boxsplit into 2 tests; buffer variant split into 2 tests.Test plan
python -m pytest test_autoarray/structures/ -v— all tests should pass[shape0]/[shape1]suffixes in output🤖 Generated with Claude Code