Repository navigation
chore: indexing test cleanup - #4001
Merged
Merged
Conversation
Plan to consolidate and speed up tests/test_indexing.py: shrink oversized arrays (>=3 chunks/axis, partial edge), replace np.random selection loops with hand-picked parametrized cases via the Expect/ExpectFail dataclasses, one-behavior-per-test isolation, and docstrings throughout. Includes a prerequisite step deduplicating the two divergent Expect dataclass pairs (tests/conftest.py vs tests/test_codecs/conftest.py) onto one canonical pair. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Task-by-task plan: Expect dataclass dedup (Part 0) then per-family rewrites of tests/test_indexing.py to parametrized Expect/ExpectFail cases on smaller arrays (Part 1), with final verification and speed measurement (Part 2). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Prepares for deduplicating the second Expect pair in test_codecs/conftest.py. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
All consumers now use the canonical Expect/ExpectFail from tests/conftest.py. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Smaller array (30 elems, chunks of 7), hand-picked deterministic masks replacing np.random sparsity sweep, error paths split into their own test. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Structural fix for the msg="" footgun discovered during Task 1.1: msg becomes optional and regex-matched via a case.raises() helper, with an escape flag. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
msg defaults to None (assert exception type only) and is treated as a regex, with an escape flag for literal messages. Removes the msg="" footgun that the repo's filterwarnings=["error"] config turned into a failure. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
np.arange(30) == 7 reads better than np.eye(1, 30, 7)[0]; matters because the other indexing families copy this exemplar. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Reuses the get-orthogonal case tables; deletes the per-dimensionality set helpers. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The basic-selection rewrite dropped two assertions that get_basic_selection rejects integer-list selections (1D direct, 2D nested in a tuple); restore them as dedicated get-only tests, since z[...] falls back to fancy indexing. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
asyncio_mode = "auto" already collects async test functions; the explicit marks were no-ops. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Rename XXXX.misc.md to the PR number when the PR is opened. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4001 +/- ##
=======================================
Coverage 93.53% 93.53%
=======================================
Files 88 88
Lines 11917 11917
=======================================
Hits 11147 11147
Misses 770 770 🚀 New features to boost your workflow:
|
This was referenced Jul 17, 2026
Closed
Closed
Closed
Closed
Closed
4 tasks done
This was referenced Jul 22, 2026
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Closed
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.
This PR applies a cleanup to our test suite, with a particular focus on the array indexing tests. The goal is to make the tests run faster with fewer lines of code, without any loss in coverage.