Skip to content

Commit 5d04cc5

Browse files
gh-102864: Add switching frame test for pdb (#119564)
1 parent 0220663 commit 5d04cc5

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Lib/test/test_pdb.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2555,7 +2555,7 @@ def test_pdb_issue_gh_94215():
25552555
def test_pdb_issue_gh_101673():
25562556
"""See GH-101673
25572557
2558-
Make sure ll won't revert local variable assignment
2558+
Make sure ll and switching frames won't revert local variable assignment
25592559
25602560
>>> def test_function():
25612561
... a = 1
@@ -2565,6 +2565,10 @@ def test_pdb_issue_gh_101673():
25652565
... '!a = 2',
25662566
... 'll',
25672567
... 'p a',
2568+
... 'u',
2569+
... 'p a',
2570+
... 'd',
2571+
... 'p a',
25682572
... 'continue'
25692573
... ]):
25702574
... test_function()
@@ -2577,6 +2581,16 @@ def test_pdb_issue_gh_101673():
25772581
3 -> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
25782582
(Pdb) p a
25792583
2
2584+
(Pdb) u
2585+
> <doctest test.test_pdb.test_pdb_issue_gh_101673[1]>(11)<module>()
2586+
-> test_function()
2587+
(Pdb) p a
2588+
*** NameError: name 'a' is not defined
2589+
(Pdb) d
2590+
> <doctest test.test_pdb.test_pdb_issue_gh_101673[0]>(3)test_function()
2591+
-> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
2592+
(Pdb) p a
2593+
2
25802594
(Pdb) continue
25812595
"""
25822596

0 commit comments

Comments
 (0)