From 8425de4147eb8d83befbb8ea77516fc764bb4309 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 1 Jun 2018 20:34:09 -0700 Subject: bpo-33562: Check the global asyncio event loop policy isn't set after any tests (GH-7328) --- Lib/test/test_contextlib_async.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Lib/test/test_contextlib_async.py') diff --git a/Lib/test/test_contextlib_async.py b/Lib/test/test_contextlib_async.py index 879ddbe0e1..355955f9ab 100644 --- a/Lib/test/test_contextlib_async.py +++ b/Lib/test/test_contextlib_async.py @@ -18,7 +18,7 @@ def _async_test(func): return loop.run_until_complete(coro) finally: loop.close() - asyncio.set_event_loop(None) + asyncio.set_event_loop_policy(None) return wrapper @@ -295,6 +295,7 @@ class TestAsyncExitStack(TestBaseExitStack, unittest.TestCase): self.loop = asyncio.new_event_loop() asyncio.set_event_loop(self.loop) self.addCleanup(self.loop.close) + self.addCleanup(asyncio.set_event_loop_policy, None) @_async_test async def test_async_callback(self): -- cgit v1.2.1