test(v1): public accessors + scoped option in groupby tests#852
Merged
FBumann merged 1 commit intoJul 20, 2026
Merged
Conversation
Polish for the #717 "polish the tests" checklist, scoped to the v1/legacy groupby-MultiIndex divergence tests in test_linear_expression.py: - Replace the manual try/finally toggle of options["semantics"] in test_group_multiindex_reset_index_matches_v1 with the `with options as o` context manager, so semantics state is restored even if the assertion fails (it was the only test bypassing the conftest marker mechanism). - Swap internal `.data.indexes` / `.data.coords` reaches for the public `.indexes` / `.coords` accessors, matching the already-public sibling tests in the same class. No behaviour change; 584 passed, ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Test polish for the #717 checklist item "polish the tests", scoped to the v1/legacy groupby-MultiIndex divergence tests in
test_linear_expression.py. Small, self-contained; no behaviour change. Stacked on #717.Note
The following was generated by AI.
What changed
test_group_multiindex_reset_index_matches_v1hand-flippedoptions["semantics"]in atry/finally. It was the only test toggling semantics outside theconftestmarker mechanism, and a failing assertion inside the block still restored state — but the pattern is fragile. Replaced with thewith options as o: o.set_value(semantics="v1")context manager..data.indexes/.data.coordsreaches for the public.indexes/.coordsaccessors (matching the already-public sibling tests in the same class).Verification
pytest test/test_linear_expression.py→ 584 passed, 122 skippedruff checkclean; pre-commit hooks pass