8000 gh-128729: Fix RuntimeWarning in test_unittest (GH-128730) · python/cpython@cb72feb · GitHub
[go: up one dir, main page]

Skip to content

Commit cb72feb

Browse files
gh-128729: Fix RuntimeWarning in test_unittest (GH-128730)
1 parent 30268b5 commit cb72feb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_unittest/test_case.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,10 @@ async def test1(self):
347347
return 1
348348

349349
with self.assertWarns(DeprecationWarning) as w:
350+
warnings.filterwarnings('ignore',
351+
'coroutine .* was never awaited', RuntimeWarning)
350352
Foo('test1').run()
353+
support.gc_collect()
351354
self.assertIn('It is deprecated to return a value that is not None', str(w.warning))
352355
self.assertIn('test1', str(w.warning))
353356
self.assertEqual(w.filename, __file__)

0 commit comments

Comments
 (0)
0