From: Ben Darnell Date: Wed, 19 Feb 2025 19:43:04 +0000 (-0500) Subject: asyncio_test: Remove obsolete cleanup logic X-Git-Tag: v6.5.0b1~26^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5526b20c5e310fe9858d3b041808c6ee9756c8cb;p=thirdparty%2Ftornado.git asyncio_test: Remove obsolete cleanup logic 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). --- diff --git a/tornado/test/asyncio_test.py b/tornado/test/asyncio_test.py index bb6416a5..3c865aae 100644 --- a/tornado/test/asyncio_test.py +++ b/tornado/test/asyncio_test.py @@ -111,10 +111,6 @@ class LeakTest(unittest.TestCase): 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: @@ -124,7 +120,6 @@ class LeakTest(unittest.TestCase): 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)