-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-128729: Fix RuntimeWarning in test_unittest #128730
gh-128729: Fix RuntimeWarning in test_unittest #128730
Conversation
serhiy-storchaka
commented
Jan 11, 2025
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: RuntimeWarning in test_unittest #128729
Lib/test/test_unittest/test_case.py
Outdated
@@ -346,8 +346,12 @@ class Foo(unittest.TestCase): | |||
async def test1(self): | |||
return 1 | |||
|
|||
with self.assertWarns(DeprecationWarning) as w: | |||
Foo('test1').run() | |||
with warnings.catch_warnings(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think neater to use check_warnings: f0490ab
(#128726)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RuntimeWarning is less important for this test.
I think that check_warnings
is too heavy for this. It requires to repeat the DeprecationWarning message.
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
Sorry, @serhiy-storchaka, I could not cleanly backport this to
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to
|