We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a570c6 commit 4e6cb96Copy full SHA for 4e6cb96
Lib/test/test_unittest/test_case.py
@@ -346,8 +346,12 @@ class Foo(unittest.TestCase):
346
async def test1(self):
347
return 1
348
349
- with self.assertWarns(DeprecationWarning) as w:
350
- Foo('test1').run()
+ with warnings.catch_warnings():
+ # Ignore RuntimeWarning: coroutine '...' was never awaited
351
+ warnings.simplefilter("ignore", RuntimeWarning)
352
+ with self.assertWarns((DeprecationWarning, )) as w:
353
+ Foo('test1').run()
354
+ support.gc_collect()
355
self.assertIn('It is deprecated to return a value that is not None', str(w.warning))
356
self.assertIn('test1', str(w.warning))
357
self.assertEqual(w.filename, __file__)
0 commit comments