Commit 433b594
Make uniform-kernel PSD warning test deterministic and assert message
Address P3 documentation/test finding from CI Codex review of PR #411
re-rerun. The original `test_uniform_kernel_negative_eigenvalue_warns`
constructed a "numerically borderline" setup with random distances and
ran the path under `warnings.catch_warnings()` but never asserted that
the warning was emitted — the comment even noted that the warning "may
or may not fire depending on numerical condition". That left the
uniform-kernel PSD-warning behavior less tightly regression-tested than
the Bartlett path (which has the assertion).
Rewrite the test to monkey-patch `_uniform_kernel` with an aggressively
indefinite kernel (same pattern as
`test_indefinite_meat_warning_fires_for_bartlett`) and assert the
`UserWarning` surfaces with `kernel='uniform'` in the message. The
warning behavior is now deterministic and locked.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0ed64e1 commit 433b594
1 file changed
Lines changed: 49 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
399 | 404 | | |
400 | | - | |
401 | | - | |
402 | | - | |
| 405 | + | |
| 406 | + | |
403 | 407 | | |
404 | | - | |
| 408 | + | |
405 | 409 | | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
419 | 444 | | |
| 445 | + | |
| 446 | + | |
420 | 447 | | |
421 | 448 | | |
422 | 449 | | |
| |||
0 commit comments