]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-128729: Fix RuntimeWarning in test_unittest (GH-128730)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 12 Jan 2025 10:22:43 +0000 (12:22 +0200)
committerGitHub <noreply@github.com>
Sun, 12 Jan 2025 10:22:43 +0000 (12:22 +0200)
Lib/test/test_unittest/test_case.py

index b4b2194a09cf9ff019ce39994d8461795653fc2d..621f8269a177ce2eb1152b961ad11590bb0e164f 100644 (file)
@@ -347,7 +347,10 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
                 return 1
 
         with self.assertWarns(DeprecationWarning) as w:
+            warnings.filterwarnings('ignore',
+                    'coroutine .* was never awaited', RuntimeWarning)
             Foo('test1').run()
+            support.gc_collect()
         self.assertIn('It is deprecated to return a value that is not None', str(w.warning))
         self.assertIn('test1', str(w.warning))
         self.assertEqual(w.filename, __file__)