From fdba8381ffb02fd888d84cbcd3c5944ee88e72a2 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Tue, 12 May 2015 14:28:08 -0400 Subject: [PATCH] Issue #24017: Unset asyncio event loop after test. --- Lib/test/test_coroutines.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index 2a452257d74..aa2a5e8ef57 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -772,13 +772,15 @@ class CoroAsyncIOCompatTest(unittest.TestCase): raise MyException buffer.append('unreachable') - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) try: loop.run_until_complete(f()) except MyException: pass finally: loop.close() + asyncio.set_event_loop(None) self.assertEqual(buffer, [1, 2, 'MyException'])