diff --git a/CHANGELOG.md b/CHANGELOG.md index cb1bf018..36613b99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and - {pull}`725` fixes the pickle node hash test by accounting for Python 3.14's default pickle protocol. +- {pull}`???` adapts the interactive debugger integration to Python 3.14's + updated `pdb` behaviour and keeps pytest-style capturing intact. ## 0.5.7 - 2025-11-22 diff --git a/tests/test_debugging.py b/tests/test_debugging.py index fc38a71b..f06e9984 100644 --- a/tests/test_debugging.py +++ b/tests/test_debugging.py @@ -182,6 +182,8 @@ def task_1(): child = pexpect.spawn(f"pytask {tmp_path.as_posix()}") child.expect(r"task_1\(\)") + child.expect("Pdb") + child.sendline("n") child.expect("i == 1") child.expect("Pdb") child.sendline("c") @@ -294,11 +296,15 @@ def task_1(): child = pexpect.spawn(f"pytask {tmp_path.as_posix()}") child.expect(["PDB", "set_trace", r"\(IO-capturing", "turned", r"off\)"]) child.expect("task_1") + child.expect("Pdb") + child.sendline("n") child.expect("x = 3") child.expect("Pdb") child.sendline("c") child.expect(["PDB", "continue", r"\(IO-capturing", r"resumed\)"]) child.expect(["PDB", "set_trace", r"\(IO-capturing", "turned", r"off\)"]) + child.expect("Pdb") + child.sendline("n") child.expect("x = 4") child.expect("Pdb") child.sendline("c") @@ -339,6 +345,15 @@ def do_debug(self, arg): do_debug.__doc__ = pdb.Pdb.do_debug.__doc__ + if hasattr(pdb.Pdb, "_create_recursive_debugger"): + + def _create_recursive_debugger(self): + return self.__class__( + self.completekey, + self.stdin, + self.stdout, + ) + def do_continue(self, *args, **kwargs): global count_continue count_continue += 1