A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/python/cpython/commit/4f4ef0acbad81f4b05f370e8ff14ddf949773291 below:

Add a test for pdb until command in coroutine (#5427) · python/cpython@4f4ef0a · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+46

-0

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+46

-0

lines changed Original file line number Diff line number Diff line change

@@ -982,6 +982,52 @@ def test_pdb_until_command_for_generator():

982 982

finished

983 983

"""

984 984 985 +

def test_pdb_until_command_for_coroutine():

986 +

"""Testing no unwindng stack for coroutines

987 +

for "until" command if target breakpoing is not reached

988 + 989 +

>>> import asyncio

990 + 991 +

>>> async def test_coro():

992 +

... print(0)

993 +

... await asyncio.sleep(0)

994 +

... print(1)

995 +

... await asyncio.sleep(0)

996 +

... print(2)

997 +

... await asyncio.sleep(0)

998 +

... print(3)

999 + 1000 +

>>> async def test_main():

1001 +

... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()

1002 +

... await test_coro()

1003 + 1004 +

>>> def test_function():

1005 +

... loop = asyncio.new_event_loop()

1006 +

... loop.run_until_complete(test_main())

1007 +

... loop.close()

1008 +

... print("finished")

1009 + 1010 +

>>> with PdbTestInput(['step',

1011 +

... 'until 8',

1012 +

... 'continue']):

1013 +

... test_function()

1014 +

> <doctest test.test_pdb.test_pdb_until_command_for_coroutine[2]>(3)test_main()

1015 +

-> await test_coro()

1016 +

(Pdb) step

1017 +

--Call--

1018 +

> <doctest test.test_pdb.test_pdb_until_command_for_coroutine[1]>(1)test_coro()

1019 +

-> async def test_coro():

1020 +

(Pdb) until 8

1021 +

0

1022 +

1

1023 +

2

1024 +

> <doctest test.test_pdb.test_pdb_until_command_for_coroutine[1]>(8)test_coro()

1025 +

-> print(3)

1026 +

(Pdb) continue

1027 +

3

1028 +

finished

1029 +

"""

1030 + 985 1031

def test_pdb_next_command_in_generator_for_loop():

986 1032

"""The next command on returning from a generator controlled by a for loop.

987 1033

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4