Commit 48c88307 authored by Benjamin Peterson's avatar Benjamin Peterson

capture stderr to silence output during test_coroutines (closes #27968)

parent b88db874
...@@ -1568,10 +1568,11 @@ class CoroutineTest(unittest.TestCase): ...@@ -1568,10 +1568,11 @@ class CoroutineTest(unittest.TestCase):
def test_fatal_coro_warning(self): def test_fatal_coro_warning(self):
# Issue 27811 # Issue 27811
async def func(): pass async def func(): pass
with warnings.catch_warnings(): with warnings.catch_warnings(), support.captured_stderr() as stderr:
warnings.filterwarnings("error") warnings.filterwarnings("error")
func() func()
support.gc_collect() support.gc_collect()
self.assertIn("was never awaited", stderr.getvalue())
class CoroAsyncIOCompatTest(unittest.TestCase): class CoroAsyncIOCompatTest(unittest.TestCase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment