Skip to content

test(v1): polish the #717 convention test suite#859

Merged
FBumann merged 2 commits into
feat/arithmetic-conventionfrom
test/polish-v1-convention-tests
Jul 20, 2026
Merged

test(v1): polish the #717 convention test suite#859
FBumann merged 2 commits into
feat/arithmetic-conventionfrom
test/polish-v1-convention-tests

Conversation

@FBumann

@FBumann FBumann commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to the #717 review — polishing the v1/legacy semantics tests.

Note

The following was generated by AI (Claude Opus 4.8), applying the polish guidelines agreed for the convention tests.

Scope: test/test_legacy_violations.py (17 convention classes) and test/test_convention.py.

What changed

  • Full-message assertions. Every v1 ValueError raise and legacy LinopySemanticsWarning now asserts the complete message text as a hardcoded literal, replacing partial match="..." substrings — so any reword of a message surfaces as a test diff (the TestLegacyWarning spec philosophy, applied everywhere).
  • DRY. Repeated operand/coord setup pulled into fixtures; near-identical tests merged via @pytest.mark.parametrize (per-operator NaN and coord-mismatch cases, the six quadratic build paths, the join modes, object-scope operand kinds, etc.).
  • Comments. Essay-length docstrings/inline comments trimmed to one crisp line where the rationale wasn't load-bearing.

Coverage
Preserved or expanded — 500 collected invocations vs 480 on the baseline; no tests removed (only merged via parametrization). Suite green under both semantics; ruff and mypy clean.

How this was produced

The 17 classes were polished in parallel by five subagents (disjoint class groups), each capturing exact message text from the linopy.semantics builders and verifying its slice with pytest under both semantics. The results were re-integrated onto the committed baseline class-by-class (via ast spans, preserving all module-level fixtures/helpers), then re-verified: full suite green, ruff + mypy clean, collected-count compared against baseline to confirm no coverage was dropped.

FBumann and others added 2 commits July 20, 2026 11:47
Applies the maintainer's polish guidelines across the v1/legacy semantics
tests (test_legacy_violations.py, test_convention.py):

- Assert FULL error/warning message text (hardcoded literals) instead of
  partial `match="..."` substrings, so every message change surfaces as a
  test diff. Covers all v1 ValueError raises and legacy LinopySemanticsWarning
  sites across the 17 convention classes.
- DRY: dedupe repeated operand/coord setup into fixtures; merge near-identical
  tests via @pytest.mark.parametrize (per-operator NaN/mismatch cases,
  quadratic build paths, join modes, object-scope operand kinds, ...).
- Trim essay-length docstrings/inline comments to one crisp line where the
  rationale isn't load-bearing.

Coverage is preserved or expanded (500 vs 480 collected invocations); no
tests removed. Suite green under both semantics; ruff + mypy clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@FBumann
FBumann merged commit 8ce901e into feat/arithmetic-convention Jul 20, 2026
1 check passed
@FBumann
FBumann deleted the test/polish-v1-convention-tests branch July 20, 2026 10:21
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