]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-128201: Fix ``DeprecationWarning`` in ``test_pdb`` (#128202)
authorKirill Podoprigora <kirill.bast9@mail.ru>
Wed, 25 Dec 2024 07:26:51 +0000 (09:26 +0200)
committerGitHub <noreply@github.com>
Wed, 25 Dec 2024 07:26:51 +0000 (12:56 +0530)
Lib/test/test_pdb.py

index 58295cff84310f77b595e2d516f21fa2ab8b91fb..9b0806d8b2a9bd110e4070001180791e3a57f627 100644 (file)
@@ -2065,10 +2065,7 @@ if not SKIP_ASYNCIO_TESTS:
         ...     await test_coro()
 
         >>> def test_function():
-        ...     loop = asyncio.new_event_loop()
-        ...     loop.run_until_complete(test_main())
-        ...     loop.close()
-        ...     asyncio.set_event_loop_policy(None)
+        ...     asyncio.run(test_main())
         ...     print("finished")
 
         >>> with PdbTestInput(['step',
@@ -2129,10 +2126,7 @@ if not SKIP_ASYNCIO_TESTS:
         ...     await test_coro()
 
         >>> def test_function():
-        ...     loop = asyncio.new_event_loop()
-        ...     loop.run_until_complete(test_main())
-        ...     loop.close()
-        ...     asyncio._set_event_loop_policy(None)
+        ...     asyncio.run(test_main())
         ...     print("finished")
 
         >>> with PdbTestInput(['step',
@@ -2250,10 +2244,7 @@ if not SKIP_ASYNCIO_TESTS:
         ...     await test_coro()
 
         >>> def test_function():
-        ...     loop = asyncio.new_event_loop()
-        ...     loop.run_until_complete(test_main())
-        ...     loop.close()
-        ...     asyncio._set_event_loop_policy(None)
+        ...     asyncio.run(test_main())
         ...     print("finished")
 
         >>> with PdbTestInput(['step',
@@ -2350,10 +2341,7 @@ if not SKIP_ASYNCIO_TESTS:
         ...     await test_coro()
 
         >>> def test_function():
-        ...     loop = asyncio.new_event_loop()
-        ...     loop.run_until_complete(test_main())
-        ...     loop.close()
-        ...     asyncio._set_event_loop_policy(None)
+        ...     asyncio.run(test_main())
         ...     print("finished")
 
         >>> with PdbTestInput(['step',