mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-33562: Check the global asyncio event loop policy isn't set after any tests (GH-7328)
This commit is contained in:
parent
de6516264e
commit
8425de4147
26 changed files with 98 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue