ci: mute dynamic __warningregistry__ logs noise in pytest suite#8893
ci: mute dynamic __warningregistry__ logs noise in pytest suite#8893Priyanshu31102003 wants to merge 1 commit into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis change adds a single warning filter to the test utilities module to suppress warnings about Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
472987e to
3cce064
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/test_utils.py (1)
31-31: ⚡ Quick winAdd explanatory comment.
No comment documents why this filter exists. Future maintainers may not understand the context.
Suggested documentation
import warnings +# Suppress noisy __warningregistry__ access warnings triggered by unittest.assertWarns (see `#8892`) warnings.filterwarnings("ignore", message=".*Accessing.*__warningregistry__.*")🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_utils.py` at line 31, Add a brief explanatory comment directly above the warnings.filterwarnings("ignore", message=".*Accessing.*__warningregistry__.*") call describing why this specific warning is being suppressed (e.g., which test/actions trigger it and that it is an expected, benign Python-internal warning), so future maintainers understand the intent; keep the comment concise and reference the exact filter line in the comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_utils.py`:
- Line 31: The warnings.filterwarnings call in tests/test_utils.py currently
uses message=".*Accessing.*__warningregistry__.*", which diverges from the test
runner's PYTHONWARNINGS pattern; change the message argument in the
warnings.filterwarnings(...) invocation to "Accessing.*__warningregistry__.*"
(or alternately add a brief comment next to that warnings.filterwarnings call
explaining why the leading ".*" was removed) so the regex matching behavior is
aligned with runtests.sh's PYTHONWARNINGS setting.
---
Nitpick comments:
In `@tests/test_utils.py`:
- Line 31: Add a brief explanatory comment directly above the
warnings.filterwarnings("ignore", message=".*Accessing.*__warningregistry__.*")
call describing why this specific warning is being suppressed (e.g., which
test/actions trigger it and that it is an expected, benign Python-internal
warning), so future maintainers understand the intent; keep the comment concise
and reference the exact filter line in the comment.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ca429843-c7ea-4cfe-bc10-0277f2ebdc6b
📒 Files selected for processing (3)
runtests.shsetup.cfgtests/test_utils.py
✅ Files skipped from review due to trivial changes (1)
- setup.cfg
🚧 Files skipped from review as they are similar to previous changes (1)
- runtests.sh
e4bb54f to
c8d201c
Compare
Signed-off-by: jet1technology-tech <jet1technology@ryngo.in>
c8d201c to
f20fb9b
Compare
Fixes #8892
Description
During automated test execution, the logs were getting flooded with thousands of verbose lines when
unittest.TestCase.assertWarnsinternally triggered property accessors for__warningregistry__on dynamic configurations.This PR globally configures
pytestinsidesetup.cfgto ignore and suppress regex pattern filter hits matching.*__warningregistry__.*, significantly cleaning up the CI/CD pipeline output logs.