Per comments, we needed to set and restore the event loop policy
in Python 3.4, but it no longer seems to be necessary (and
raises DeprecationWarnings in Python 3.14).
def setUp(self):
# Trigger a cleanup of the mapping so we start with a clean slate.
AsyncIOLoop(make_current=False).close()
- # If we don't clean up after ourselves other tests may fail on
- # py34.
- self.orig_policy = asyncio.get_event_loop_policy()
- asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy())
def tearDown(self):
try:
pass
else:
loop.close()
- asyncio.set_event_loop_policy(self.orig_policy)
def test_ioloop_close_leak(self):
orig_count = len(IOLoop._ioloop_for_asyncio)