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 4e6cb96 commit d967418Copy full SHA for d967418
Lib/test/test_unittest/test_case.py
@@ -346,11 +346,10 @@ class Foo(unittest.TestCase):
346
async def test1(self):
347
return 1
348
349
- with warnings.catch_warnings():
350
- # Ignore RuntimeWarning: coroutine '...' was never awaited
351
- warnings.simplefilter("ignore", RuntimeWarning)
352
- with self.assertWarns((DeprecationWarning, )) as w:
353
- Foo('test1').run()
+ with self.assertWarns(DeprecationWarning) as w:
+ warnings.filterwarnings('ignore',
+ 'coroutine .* was never awaited', RuntimeWarning)
+ 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))
0 commit comments