File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -979,6 +979,52 @@ def test_pdb_until_command_for_generator():
979979 finished
980980 """
981981
982+ def test_pdb_until_command_for_coroutine ():
983+ """Testing no unwindng stack for coroutines
984+ for "until" command if target breakpoing is not reached
985+
986+ >>> import asyncio
987+
988+ >>> async def test_coro():
989+ ... print(0)
990+ ... await asyncio.sleep(0)
991+ ... print(1)
992+ ... await asyncio.sleep(0)
993+ ... print(2)
994+ ... await asyncio.sleep(0)
995+ ... print(3)
996+
997+ >>> async def test_main():
998+ ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
999+ ... await test_coro()
1000+
1001+ >>> def test_function():
1002+ ... loop = asyncio.new_event_loop()
1003+ ... loop.run_until_complete(test_main())
1004+ ... loop.close()
1005+ ... print("finished")
1006+
1007+ >>> with PdbTestInput(['step',
1008+ ... 'until 8',
1009+ ... 'continue']):
1010+ ... test_function()
1011+ > <doctest test.test_pdb.test_pdb_until_command_for_coroutine[2]>(3)test_main()
1012+ -> await test_coro()
1013+ (Pdb) step
1014+ --Call--
1015+ > <doctest test.test_pdb.test_pdb_until_command_for_coroutine[1]>(1)test_coro()
1016+ -> async def test_coro():
1017+ (Pdb) until 8
1018+ 0
1019+ 1
1020+ 2
1021+ > <doctest test.test_pdb.test_pdb_until_command_for_coroutine[1]>(8)test_coro()
1022+ -> print(3)
1023+ (Pdb) continue
1024+ 3
1025+ finished
1026+ """
1027+
9821028def test_pdb_next_command_in_generator_for_loop ():
9831029 """The next command on returning from a generator controlled by a for loop.
9841030
You can’t perform that action at this time.
0 commit comments