diff options
author | Tian Gao <gaogaotiantian@hotmail.com> | 2023-11-04 19:59:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-04 19:59:36 (GMT) |
commit | cd6b2ced7595fa69222bdd2042edc5a2576f3678 (patch) | |
tree | bd57eba227f0d1e9b81da0626308a22a0c6714ec /Lib/test/test_pdb.py | |
parent | 9573d142157d8432f2772a109c304dafeaa454a5 (diff) | |
download | cpython-cd6b2ced7595fa69222bdd2042edc5a2576f3678.zip cpython-cd6b2ced7595fa69222bdd2042edc5a2576f3678.tar.gz cpython-cd6b2ced7595fa69222bdd2042edc5a2576f3678.tar.bz2 |
gh-80675: Set `f_trace_lines = True` on all frames upon `pdb.set_trace()` (#110881)
Diffstat (limited to 'Lib/test/test_pdb.py')
-rw-r--r-- | Lib/test/test_pdb.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index 5fef836..ff9e7c2 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -2350,6 +2350,30 @@ def test_pdb_ambiguous_statements(): (Pdb) continue """ +def test_pdb_f_trace_lines(): + """GH-80675 + + pdb should work even if f_trace_lines is set to False on some frames. + + >>> reset_Breakpoint() + + >>> def test_function(): + ... import sys + ... frame = sys._getframe() + ... frame.f_trace_lines = False + ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace() + ... if frame.f_trace_lines != False: + ... print("f_trace_lines is not reset after continue!") + + >>> with PdbTestInput([ # doctest: +NORMALIZE_WHITESPACE + ... 'continue' + ... ]): + ... test_function() + > <doctest test.test_pdb.test_pdb_f_trace_lines[1]>(6)test_function() + -> if frame.f_trace_lines != False: + (Pdb) continue + """ + def test_pdb_function_break(): """Testing the line number of break on function |