From: Yury Selivanov Date: Tue, 12 May 2015 18:28:08 +0000 (-0400) Subject: Issue #24017: Unset asyncio event loop after test. X-Git-Tag: v3.5.0b1~186 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fdba8381ffb02fd888d84cbcd3c5944ee88e72a2;p=thirdparty%2FPython%2Fcpython.git Issue #24017: Unset asyncio event loop after test. --- diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index 2a452257d74f..aa2a5e8ef57f 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'])