From: Benjamin Peterson Date: Wed, 7 Sep 2016 16:00:48 +0000 (-0700) Subject: capture stderr to silence output during test_coroutines (closes #27968) X-Git-Tag: v3.6.0b1~346^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48c88307d87ae0704885b9b5c692ded861077a71;p=thirdparty%2FPython%2Fcpython.git capture stderr to silence output during test_coroutines (closes #27968) --- diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index 79cbec9899b0..e52654c14d01 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -1568,10 +1568,11 @@ class CoroutineTest(unittest.TestCase): def test_fatal_coro_warning(self): # Issue 27811 async def func(): pass - with warnings.catch_warnings(): + with warnings.catch_warnings(), support.captured_stderr() as stderr: warnings.filterwarnings("error") func() support.gc_collect() + self.assertIn("was never awaited", stderr.getvalue()) class CoroAsyncIOCompatTest(unittest.TestCase):