Kaydet (Commit) b8e973f9 authored tarafından Berker Peksag's avatar Berker Peksag

Issue #23027: test_warnings now passes all tests when run it with -Werror.

üst d0962083
...@@ -456,6 +456,9 @@ class WarnTests(BaseTest): ...@@ -456,6 +456,9 @@ class WarnTests(BaseTest):
self.assertIn('category must be a Warning subclass, not ', self.assertIn('category must be a Warning subclass, not ',
str(cm.exception)) str(cm.exception))
with original_warnings.catch_warnings(module=self.module):
self.module.resetwarnings()
self.module.filterwarnings('default')
with self.assertWarns(MyWarningClass) as cm: with self.assertWarns(MyWarningClass) as cm:
self.module.warn('good warning category', MyWarningClass) self.module.warn('good warning category', MyWarningClass)
self.assertEqual('good warning category', str(cm.warning)) self.assertEqual('good warning category', str(cm.warning))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment