Browse Source

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

pull/40/head
Benjamin Peterson 10 years ago
parent
commit
48c88307d8
  1. 3
      Lib/test/test_coroutines.py

3
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):

Loading…
Cancel
Save