https://github.com/python/cpython/commit/d9ed42bc00c74b3150be2a0eb28da03e01dffcc7
commit: d9ed42bc00c74b3150be2a0eb28da03e01dffcc7
branch: main
author: Kirill Podoprigora <[email protected]>
committer: kumaraditya303 <[email protected]>
date: 2024-12-25T12:56:51+05:30
summary:

gh-128201: Fix ``DeprecationWarning`` in ``test_pdb`` (#128202)

files:
M Lib/test/test_pdb.py

diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
index 58295cff84310f..9b0806d8b2a9bd 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
@@ -2065,10 +2065,7 @@ def test_pdb_next_command_for_coroutine():
         ...     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 @@ def test_pdb_next_command_for_asyncgen():
         ...     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 @@ def test_pdb_return_command_for_coroutine():
         ...     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 @@ def test_pdb_until_command_for_coroutine():
         ...     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',

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to