diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9158d6bcc7..3131f487ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -147,7 +147,7 @@ jobs: - name: "ubuntu-py313" python: "3.13-dev" os: ubuntu-latest - tox_env: "py313" + tox_env: "py313-pexpect" use_coverage: true - name: "ubuntu-pypy3" python: "pypy-3.9" diff --git a/changelog/12497.contrib.rst b/changelog/12497.contrib.rst new file mode 100644 index 0000000000..ccf8973105 --- /dev/null +++ b/changelog/12497.contrib.rst @@ -0,0 +1 @@ +Fixed two failing pdb-related tests on Python 3.13. diff --git a/testing/test_debugging.py b/testing/test_debugging.py index 37032f9235..73a4b769ff 100644 --- a/testing/test_debugging.py +++ b/testing/test_debugging.py @@ -768,9 +768,13 @@ def test_pdb_used_outside_test(self, pytester: Pytester) -> None: x = 5 """ ) + if sys.version_info[:2] >= (3, 13): + break_line = "pytest.set_trace()" + else: + break_line = "x = 5" child = pytester.spawn(f"{sys.executable} {p1}") - child.expect("x = 5") - child.expect("Pdb") + child.expect_exact(break_line) + child.expect_exact("Pdb") child.sendeof() self.flush(child) @@ -785,9 +789,13 @@ def test_foo(a): pass """ ) + if sys.version_info[:2] >= (3, 13): + break_line = "pytest.set_trace()" + else: + break_line = "x = 5" child = pytester.spawn_pytest(str(p1)) - child.expect("x = 5") - child.expect("Pdb") + child.expect_exact(break_line) + child.expect_exact("Pdb") child.sendeof() self.flush(child)