Skip to content

Commit 7a73ff1

Browse files
authored
Test #312 by unxfailing pdb capture tests in CI (#788)
1 parent 9bbc2a0 commit 7a73ff1

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
1717
compacted on normal build exits.
1818
- {pull}`776` clears decoration-time `annotation_locals` snapshots after collection so
1919
task functions remain picklable in process-based parallel backends.
20+
- {pull}`788` updates debugger interaction tests to support Python-version-specific
21+
`pdb` stepping behavior and avoid frame-specific assumptions on repeated breakpoints.
2022

2123
## 0.5.8 - 2025-12-30
2224

tests/test_debugging.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ def task_example():
165165
_flush(child)
166166

167167

168-
@pytest.mark.xfail(os.environ.get("CI") == "true", reason="#312")
169168
@pytest.mark.skipif(not IS_PEXPECT_INSTALLED, reason="pexpect is not installed.")
170169
@pytest.mark.skipif(sys.platform == "win32", reason="pexpect cannot spawn on Windows.")
171170
def test_pdb_interaction_capturing_simple(tmp_path): # pragma: no cover
@@ -184,7 +183,9 @@ def task_1():
184183
child.expect(r"task_1\(\)")
185184
child.expect("Pdb")
186185
child.sendline("n")
187-
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"])
188189
child.expect("Pdb")
189190
child.sendline("c")
190191
rest = child.read().decode("utf-8")
@@ -275,7 +276,6 @@ def task_2():
275276
_flush(child)
276277

277278

278-
@pytest.mark.xfail(os.environ.get("CI") == "true", reason="#312")
279279
@pytest.mark.skipif(not IS_PEXPECT_INSTALLED, reason="pexpect is not installed.")
280280
@pytest.mark.skipif(sys.platform == "win32", reason="pexpect cannot spawn on Windows.")
281281
def test_pdb_interaction_capturing_twice(tmp_path): # pragma: no cover
@@ -295,21 +295,13 @@ def task_1():
295295

296296
child = pexpect.spawn(f"pytask {tmp_path.as_posix()}")
297297
child.expect(["PDB", "set_trace", r"\(IO-capturing", "turned", r"off\)"])
298-
child.expect("task_1")
299-
child.expect("Pdb")
300-
child.sendline("n")
301-
child.expect("x = 3")
302298
child.expect("Pdb")
303299
child.sendline("c")
304300
child.expect(["PDB", "continue", r"\(IO-capturing", r"resumed\)"])
305301
child.expect(["PDB", "set_trace", r"\(IO-capturing", "turned", r"off\)"])
306302
child.expect("Pdb")
307-
child.sendline("n")
308-
child.expect("x = 4")
309-
child.expect("Pdb")
310303
child.sendline("c")
311304
child.expect(["PDB", "continue", r"\(IO-capturing", r"resumed\)"])
312-
child.expect("task_1")
313305
child.expect("failed")
314306
rest = _escape_ansi(child.read().decode("utf8"))
315307
assert "Captured stdout during call" in rest

0 commit comments

Comments
 (0)