Skip to content

test(v1): public accessors + scoped option in groupby tests#852

Merged
FBumann merged 1 commit into
feat/arithmetic-conventionfrom
test/v1-groupby-public-accessors
Jul 20, 2026
Merged

test(v1): public accessors + scoped option in groupby tests#852
FBumann merged 1 commit into
feat/arithmetic-conventionfrom
test/v1-groupby-public-accessors

Conversation

@FBumann

@FBumann FBumann commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

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_v1 hand-flipped options["semantics"] in a try/finally. It was the only test toggling semantics outside the conftest marker mechanism, and a failing assertion inside the block still restored state — but the pattern is fragile. Replaced with the with options as o: o.set_value(semantics="v1") context manager.
  • Swapped internal .data.indexes / .data.coords reaches for the public .indexes / .coords accessors (matching the already-public sibling tests in the same class).

Verification

  • pytest test/test_linear_expression.py → 584 passed, 122 skipped
  • ruff check clean; pre-commit hooks pass

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>
@FBumann
FBumann merged commit ddf3762 into feat/arithmetic-convention Jul 20, 2026
1 of 2 checks passed
@FBumann
FBumann deleted the test/v1-groupby-public-accessors branch July 20, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant