Skip to content

Commit

Permalink
gh-128729: Fix RuntimeWarning in test_unittest (GH-128730)
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka authored Jan 12, 2025
1 parent 30268b5 commit cb72feb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Lib/test/test_unittest/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,10 @@ async def test1(self):
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__)
Expand Down

0 comments on commit cb72feb

Please sign in to comment.