Skip to content

Commit 0669aca

Browse files
committed
Stabilize pdb interaction tests across Python versions
1 parent 7c94355 commit 0669aca

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tests/test_debugging.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ def task_1():
183183
child.expect(r"task_1\(\)")
184184
child.expect("Pdb")
185185
child.sendline("n")
186-
child.expect("i == 1")
186+
# Python < 3.13 stops at the next statement already, while Python >= 3.13
187+
# first stops on the set_trace call itself and reaches this line after "n".
188+
child.expect(["i == 1", "assert 0"])
187189
child.expect("Pdb")
188190
child.sendline("c")
189191
rest = child.read().decode("utf-8")
@@ -296,14 +298,14 @@ def task_1():
296298
child.expect("task_1")
297299
child.expect("Pdb")
298300
child.sendline("n")
299-
child.expect("x = 3")
301+
child.expect([r"x = 3", r'print\("hello18"\)'])
300302
child.expect("Pdb")
301303
child.sendline("c")
302304
child.expect(["PDB", "continue", r"\(IO-capturing", r"resumed\)"])
303305
child.expect(["PDB", "set_trace", r"\(IO-capturing", "turned", r"off\)"])
304306
child.expect("Pdb")
305307
child.sendline("n")
306-
child.expect("x = 4")
308+
child.expect([r"x = 4", "assert 0"])
307309
child.expect("Pdb")
308310
child.sendline("c")
309311
child.expect(["PDB", "continue", r"\(IO-capturing", r"resumed\)"])

0 commit comments

Comments
 (0)