From: Serhiy Storchaka Date: Sun, 12 Jan 2025 10:22:43 +0000 (+0200) Subject: gh-128729: Fix RuntimeWarning in test_unittest (GH-128730) X-Git-Tag: v3.14.0a4~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cb72feb8a30edb448bc8dc31330ed7420279d7c2;p=thirdparty%2FPython%2Fcpython.git gh-128729: Fix RuntimeWarning in test_unittest (GH-128730) --- diff --git a/Lib/test/test_unittest/test_case.py b/Lib/test/test_unittest/test_case.py index b4b2194a09cf..621f8269a177 100644 --- a/Lib/test/test_unittest/test_case.py +++ b/Lib/test/test_unittest/test_case.py @@ -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__)