Skip to content

Commit 7ea81cd

Browse files
committed
Fix test_decorator_skip_with_breakpoint() on Python 3.13
1 parent 473f4f3 commit 7ea81cd

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

IPython/core/tests/test_debugger.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,18 @@ def test_decorator_skip_with_breakpoint():
497497
child.expect_exact(line)
498498
child.sendline("")
499499

500-
# as the filename does not exists, we'll rely on the filename prompt
501-
child.expect_exact("47 bar(3, 4)")
500+
# From 3.13, set_trace()/breakpoint() stop on the line where they're
501+
# called, instead of the next line.
502+
if sys.version_info >= (3, 13):
503+
child.expect_exact("--> 46 ipdb.set_trace()")
504+
extra_step = [("step", "--> 47 bar(3, 4)")]
505+
else:
506+
child.expect_exact("--> 47 bar(3, 4)")
507+
extra_step = []
502508

503509
for input_, expected in [
504510
(f"b {name}.py:3", ""),
511+
] + extra_step + [
505512
("step", "1---> 3 pass # should not stop here except"),
506513
("step", "---> 38 @pdb_skipped_decorator"),
507514
("continue", ""),

0 commit comments

Comments
 (0)