test(v1): polish the #717 convention test suite#859
Merged
FBumann merged 2 commits intoJul 20, 2026
Conversation
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>
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.
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) andtest/test_convention.py.What changed
ValueErrorraise and legacyLinopySemanticsWarningnow asserts the complete message text as a hardcoded literal, replacing partialmatch="..."substrings — so any reword of a message surfaces as a test diff (theTestLegacyWarningspec philosophy, applied everywhere).@pytest.mark.parametrize(per-operator NaN and coord-mismatch cases, the six quadratic build paths, the join modes, object-scope operand kinds, etc.).Coverage
Preserved or expanded — 500 collected invocations vs 480 on the baseline; no tests removed (only merged via parametrization). Suite green under both semantics;
ruffandmypyclean.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.semanticsbuilders and verifying its slice withpytestunder both semantics. The results were re-integrated onto the committed baseline class-by-class (viaastspans, 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.