| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The test asserted the total recwarn count was exactly 1, but recwarn records every warning emitted during the test. In the full suite a stray warning leaked from another module could add a second entry, making the assertion flaky depending on test order. Filter recwarn for the specific "third" warning the test cares about instead of asserting on the total count. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Results 📊✅ 91185 passed | ⏭️ 6302 skipped | Total: 97487 | Pass Rate: 93.54% | Execution Time: 313m 46s 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 2445 uncovered lines. @@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 89.80% 89.77% -0.03%
==========================================
Files 193 193 —
Lines 23898 23898 —
Branches 8258 8258 —
==========================================
+ Hits 21461 21453 -8
- Misses 2437 2445 +8
- Partials 1353 1355 +2Generated by Codecov Action |
Sorry, something went wrong.
## Summary Fixes a flaky failure in `tests/integrations/logging/test_logging.py::test_logging_captured_warnings` seen in CI (`assert len(recwarn) == 1` failing with `assert 2 == 1`). ## Root cause The `recwarn` fixture records **every** warning emitted during the test. The test asserted the total count was exactly 1, which holds in isolation and in file order, but fails in the full `tests` suite when an unrelated warning leaks in from another module (warning filter/registry state is process-global). Whether it reproduces depends on test ordering. ## Fix Filter `recwarn` for the specific `"third"` warning the test actually cares about instead of asserting on the total count. This preserves the test's intent — verifying that `"third"` (emitted after `captureWarnings(False)`) is not captured by Sentry but surfaces as a normal warning — while being immune to stray warnings from other tests. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Summary
Fixes a flaky failure in tests/integrations/logging/test_logging.py::test_logging_captured_warnings seen in CI (assert len(recwarn) == 1 failing with assert 2 == 1).
Root cause
The recwarn fixture records every warning emitted during the test. The test asserted the total count was exactly 1, which holds in isolation and in file order, but fails in the full tests suite when an unrelated warning leaks in from another module (warning filter/registry state is process-global). Whether it reproduces depends on test ordering.
Fix
Filter recwarn for the specific "third" warning the test actually cares about instead of asserting on the total count. This preserves the test's intent — verifying that "third" (emitted after captureWarnings(False)) is not captured by Sentry but surfaces as a normal warning — while being immune to stray warnings from other tests.