Skip to content

Commit 3a33b6a

Browse files
committed
Try using asyncio.run
1 parent 973510f commit 3a33b6a

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

Lib/test/test_pdb.py

+4-16
Original file line numberDiff line numberDiff line change
@@ -1708,10 +1708,7 @@ def test_pdb_next_command_for_coroutine():
17081708
... await test_coro()
17091709
17101710
>>> def test_function():
1711-
... loop = asyncio.new_event_loop()
1712-
... loop.run_until_complete(test_main())
1713-
... loop.close()
1714-
... asyncio.set_event_loop_policy(None)
1711+
... asyncio.run(test_main())
17151712
... print("finished")
17161713
17171714
>>> with PdbTestInput(['step',
@@ -1768,10 +1765,7 @@ def test_pdb_next_command_for_asyncgen():
17681765
... await test_coro()
17691766
17701767
>>> def test_function():
1771-
... loop = asyncio.new_event_loop()
1772-
... loop.run_until_complete(test_main())
1773-
... loop.close()
1774-
... asyncio.set_event_loop_policy(None)
1768+
... asyncio.run(test_main())
17751769
... print("finished")
17761770
17771771
>>> with PdbTestInput(['step',
@@ -1880,10 +1874,7 @@ def test_pdb_return_command_for_coroutine():
18801874
... await test_coro()
18811875
18821876
>>> def test_function():
1883-
... loop = asyncio.new_event_loop()
1884-
... loop.run_until_complete(test_main())
1885-
... loop.close()
1886-
... asyncio.set_event_loop_policy(None)
1877+
... asyncio.run(test_main())
18871878
... print("finished")
18881879
18891880
>>> with PdbTestInput(['step',
@@ -1971,10 +1962,7 @@ def test_pdb_until_command_for_coroutine():
19711962
... await test_coro()
19721963
19731964
>>> def test_function():
1974-
... loop = asyncio.new_event_loop()
1975-
... loop.run_until_complete(test_main())
1976-
... loop.close()
1977-
... asyncio.set_event_loop_policy(None)
1965+
... asyncio.run(test_main())
19781966
... print("finished")
19791967
19801968
>>> with PdbTestInput(['step',

0 commit comments

Comments
 (0)