Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add regression test for the bug
  • Loading branch information
gaogaotiantian committed Mar 12, 2023
commit 121e00ba88d12173f1ba6e1f42e4d905c23dffd2
29 changes: 29 additions & 0 deletions Lib/test/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,35 @@ def test_pdb_issue_gh_94215():
(Pdb) continue
"""

def test_pdb_issue_gh_101673():
"""See GH-101673

Make sure ll won't revert local variable assignment

>>> def test_function():
... a = 1
... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()

>>> with PdbTestInput([ # doctest: +NORMALIZE_WHITESPACE
... '!a = 2',
... 'll',
... 'p a',
... 'continue'
... ]):
... test_function()
--Return--
> <doctest test.test_pdb.test_pdb_issue_gh_101673[0]>(3)test_function()->None
-> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
(Pdb) !a = 2
(Pdb) ll
1 def test_function():
2 a = 1
3 -> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
(Pdb) p a
2
(Pdb) continue
"""


@support.requires_subprocess()
class PdbTestCase(unittest.TestCase):
Expand Down