File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -2059,6 +2059,29 @@ def test_pdb_next_command_for_generator():
20592059 """
20602060
20612061if not SKIP_CORO_TESTS :
2062+ def test_pdb_asynctask ():
2063+ """Testing $_asynctask is accessible in async context
2064+
2065+ >>> import asyncio
2066+
2067+ >>> async def test():
2068+ ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
2069+
2070+ >>> def test_function():
2071+ ... asyncio.run(test())
2072+
2073+ >>> with PdbTestInput([ # doctest: +ELLIPSIS
2074+ ... '$_asynctask',
2075+ ... 'continue',
2076+ ... ]):
2077+ ... test_function()
2078+ > <doctest test.test_pdb.test_pdb_asynctask[1]>(2)test()
2079+ -> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
2080+ (Pdb) $_asynctask
2081+ <Task pending name='Task-1' coro=<test() running at <doctest test.test_pdb.test_pdb_asynctask[1]>:2> ...
2082+ (Pdb) continue
2083+ """
2084+
20622085 def test_pdb_next_command_for_coroutine ():
20632086 """Testing skip unwinding stack on yield for coroutines for "next" command
20642087
You can’t perform that action at this time.
0 commit comments