From: Tian Gao Date: Sun, 26 May 2024 17:05:23 +0000 (-0700) Subject: gh-102864: Add switching frame test for pdb (#119564) X-Git-Tag: v3.14.0a1~1760 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5d04cc50e51cb262ee189a6ef0e79f4b372d1583;p=thirdparty%2FPython%2Fcpython.git gh-102864: Add switching frame test for pdb (#119564) --- diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index 1b329b205d2d..cf69bc415c9b 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -2555,7 +2555,7 @@ def test_pdb_issue_gh_94215(): def test_pdb_issue_gh_101673(): """See GH-101673 - Make sure ll won't revert local variable assignment + Make sure ll and switching frames won't revert local variable assignment >>> def test_function(): ... a = 1 @@ -2565,6 +2565,10 @@ def test_pdb_issue_gh_101673(): ... '!a = 2', ... 'll', ... 'p a', + ... 'u', + ... 'p a', + ... 'd', + ... 'p a', ... 'continue' ... ]): ... test_function() @@ -2577,6 +2581,16 @@ def test_pdb_issue_gh_101673(): 3 -> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace() (Pdb) p a 2 + (Pdb) u + > (11)() + -> test_function() + (Pdb) p a + *** NameError: name 'a' is not defined + (Pdb) d + > (3)test_function() + -> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace() + (Pdb) p a + 2 (Pdb) continue """