mirror of https://github.com/pytest-dev/pytest.git
Fix pdb selftests on Python 3.13
Python 3.13 makes pdb break on the breakpoint() call, rather than on the next line: https://docs.python.org/3/whatsnew/3.13.html#pdb Also runs the pdb tests on Python 3.13 in CI. See #12884 for a more proper solution for that. Fixes #12497
This commit is contained in:
parent
f373974707
commit
f92597c664
|
@ -147,7 +147,7 @@ jobs:
|
||||||
- name: "ubuntu-py313"
|
- name: "ubuntu-py313"
|
||||||
python: "3.13-dev"
|
python: "3.13-dev"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
tox_env: "py313"
|
tox_env: "py313-pexpect"
|
||||||
use_coverage: true
|
use_coverage: true
|
||||||
- name: "ubuntu-pypy3"
|
- name: "ubuntu-pypy3"
|
||||||
python: "pypy-3.9"
|
python: "pypy-3.9"
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Fixed two failing pdb-related tests on Python 3.13.
|
|
@ -771,9 +771,13 @@ class TestPDB:
|
||||||
x = 5
|
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 = pytester.spawn(f"{sys.executable} {p1}")
|
||||||
child.expect("x = 5")
|
child.expect_exact(break_line)
|
||||||
child.expect("Pdb")
|
child.expect_exact("Pdb")
|
||||||
child.sendeof()
|
child.sendeof()
|
||||||
self.flush(child)
|
self.flush(child)
|
||||||
|
|
||||||
|
@ -788,9 +792,13 @@ class TestPDB:
|
||||||
pass
|
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 = pytester.spawn_pytest(str(p1))
|
||||||
child.expect("x = 5")
|
child.expect_exact(break_line)
|
||||||
child.expect("Pdb")
|
child.expect_exact("Pdb")
|
||||||
child.sendeof()
|
child.sendeof()
|
||||||
self.flush(child)
|
self.flush(child)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue