]> granicus.if.org Git - python/commitdiff
Issue #24017: Unset asyncio event loop after test.
authorYury Selivanov <yselivanov@sprymix.com>
Tue, 12 May 2015 18:28:08 +0000 (14:28 -0400)
committerYury Selivanov <yselivanov@sprymix.com>
Tue, 12 May 2015 18:28:08 +0000 (14:28 -0400)
Lib/test/test_coroutines.py

index 2a452257d74ff4c5adde2fa26b6e7f30441d2b58..aa2a5e8ef57f88f58184eafded58c3fcb8c1d43f 100644 (file)
@@ -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'])