mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
[3.13] gh-119824: Print stack entry when user input is needed (GH-119882) (#120533)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
parent
6ee68fbf9b
commit
1c41aa78d8
3 changed files with 81 additions and 18 deletions
|
@ -781,7 +781,7 @@ def test_pdb_where_command():
|
|||
... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
|
||||
|
||||
>>> def f():
|
||||
... g();
|
||||
... g()
|
||||
|
||||
>>> def test_function():
|
||||
... f()
|
||||
|
@ -789,8 +789,13 @@ def test_pdb_where_command():
|
|||
>>> with PdbTestInput([ # doctest: +ELLIPSIS
|
||||
... 'w',
|
||||
... 'where',
|
||||
... 'w 1',
|
||||
... 'w invalid',
|
||||
... 'u',
|
||||
... 'w',
|
||||
... 'w 0',
|
||||
... 'w 100',
|
||||
... 'w -100',
|
||||
... 'continue',
|
||||
... ]):
|
||||
... test_function()
|
||||
|
@ -798,35 +803,63 @@ def test_pdb_where_command():
|
|||
-> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
|
||||
(Pdb) w
|
||||
...
|
||||
<doctest test.test_pdb.test_pdb_where_command[3]>(8)<module>()
|
||||
<doctest test.test_pdb.test_pdb_where_command[3]>(13)<module>()
|
||||
-> test_function()
|
||||
<doctest test.test_pdb.test_pdb_where_command[2]>(2)test_function()
|
||||
-> f()
|
||||
<doctest test.test_pdb.test_pdb_where_command[1]>(2)f()
|
||||
-> g();
|
||||
-> g()
|
||||
> <doctest test.test_pdb.test_pdb_where_command[0]>(2)g()
|
||||
-> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
|
||||
(Pdb) where
|
||||
...
|
||||
<doctest test.test_pdb.test_pdb_where_command[3]>(8)<module>()
|
||||
<doctest test.test_pdb.test_pdb_where_command[3]>(13)<module>()
|
||||
-> test_function()
|
||||
<doctest test.test_pdb.test_pdb_where_command[2]>(2)test_function()
|
||||
-> f()
|
||||
<doctest test.test_pdb.test_pdb_where_command[1]>(2)f()
|
||||
-> g();
|
||||
-> g()
|
||||
> <doctest test.test_pdb.test_pdb_where_command[0]>(2)g()
|
||||
-> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
|
||||
(Pdb) w 1
|
||||
> <doctest test.test_pdb.test_pdb_where_command[0]>(2)g()
|
||||
-> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
|
||||
(Pdb) w invalid
|
||||
*** Invalid count (invalid)
|
||||
(Pdb) u
|
||||
> <doctest test.test_pdb.test_pdb_where_command[1]>(2)f()
|
||||
-> g();
|
||||
-> g()
|
||||
(Pdb) w
|
||||
...
|
||||
<doctest test.test_pdb.test_pdb_where_command[3]>(8)<module>()
|
||||
<doctest test.test_pdb.test_pdb_where_command[3]>(13)<module>()
|
||||
-> test_function()
|
||||
<doctest test.test_pdb.test_pdb_where_command[2]>(2)test_function()
|
||||
-> f()
|
||||
> <doctest test.test_pdb.test_pdb_where_command[1]>(2)f()
|
||||
-> g();
|
||||
-> g()
|
||||
<doctest test.test_pdb.test_pdb_where_command[0]>(2)g()
|
||||
-> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
|
||||
(Pdb) w 0
|
||||
> <doctest test.test_pdb.test_pdb_where_command[1]>(2)f()
|
||||
-> g()
|
||||
(Pdb) w 100
|
||||
...
|
||||
<doctest test.test_pdb.test_pdb_where_command[3]>(13)<module>()
|
||||
-> test_function()
|
||||
<doctest test.test_pdb.test_pdb_where_command[2]>(2)test_function()
|
||||
-> f()
|
||||
> <doctest test.test_pdb.test_pdb_where_command[1]>(2)f()
|
||||
-> g()
|
||||
<doctest test.test_pdb.test_pdb_where_command[0]>(2)g()
|
||||
-> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
|
||||
(Pdb) w -100
|
||||
...
|
||||
<doctest test.test_pdb.test_pdb_where_command[3]>(13)<module>()
|
||||
-> test_function()
|
||||
<doctest test.test_pdb.test_pdb_where_command[2]>(2)test_function()
|
||||
-> f()
|
||||
> <doctest test.test_pdb.test_pdb_where_command[1]>(2)f()
|
||||
-> g()
|
||||
<doctest test.test_pdb.test_pdb_where_command[0]>(2)g()
|
||||
-> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
|
||||
(Pdb) continue
|
||||
|
@ -3165,6 +3198,7 @@ def bœr():
|
|||
stdout, stderr = self.run_pdb_script(script, 'q\n', pdbrc=pdbrc, remove_home=True)
|
||||
self.assertNotIn("SyntaxError", stdout)
|
||||
self.assertIn("a+8=9", stdout)
|
||||
self.assertIn("-> b = 2", stdout)
|
||||
|
||||
def test_pdbrc_empty_line(self):
|
||||
"""Test that empty lines in .pdbrc are ignored."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue