Commit 54efaea
Address PR #453 R2 review (1 P3, isolate heavy-rejection test branch)
P3 — `test_enumerate_vertices_warns_on_heavy_rejection` previously used
a fixture (X_tilde with 2 unique row types, 5 moments → all 3-row bases
singular) where the assertion could pass via the `exhausted` warning
instead of the intended `heavily constrained` branch. The branch was
effectively untested.
Rewrite the fixture: 5 moments × 1 nuisance column, C(5,2)=10 bases. By
design, 6 bases trip LinAlgError (pairs among the singular-X_tilde
indices) and 4 bases produce feasible vertices (each pairs a positive
X_tilde with the unique negative X_tilde at index 4). 60% rejection rate
hits the heavily-constrained branch specifically, not exhaustion.
Switched to `pytest.warns(RuntimeWarning, match="heavily constrained")`
so the test now fails if the message changes or if the wrong branch
fires. Added a `len(vertices) >= 1` assertion to guard against the
fixture inadvertently producing the exhausted-branch outcome.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 7c0bdb2 commit 54efaea
1 file changed
Lines changed: 14 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
524 | 527 | | |
525 | 528 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
538 | 532 | | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
546 | 537 | | |
547 | 538 | | |
548 | 539 | | |
| |||
0 commit comments