]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
asyncio_test: Remove obsolete cleanup logic
authorBen Darnell <ben@bendarnell.com>
Wed, 19 Feb 2025 19:43:04 +0000 (14:43 -0500)
committerBen Darnell <ben@bendarnell.com>
Wed, 19 Feb 2025 19:43:04 +0000 (14:43 -0500)
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).

tornado/test/asyncio_test.py

index bb6416a549f3dfb8e9f084087de10cebd3faa246..3c865aae5fda1ee1cfa110d7e76488c20d70ae71 100644 (file)
@@ -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)