Skip to content

Commit 7ef4491

Browse files
committed
tests: debugging: disable pdb++ within inner tests
Ref: pytest-dev#5306 (comment)
1 parent 813ef9e commit 7ef4491

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

testing/test_pdb.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
_ENVIRON_PYTHONBREAKPOINT = os.environ.get("PYTHONBREAKPOINT", "")
1818

1919

20+
@pytest.fixture(autouse=True)
21+
def pdb_env(request):
22+
if "testdir" in request.fixturenames:
23+
# Disable pdb++ with inner tests.
24+
testdir = request.getfixturevalue("testdir")
25+
testdir._env_run_update["PDBPP_HIJACK_PDB"] = "0"
26+
27+
2028
def runpdb_and_get_report(testdir, source):
2129
p = testdir.makepyfile(source)
2230
result = testdir.runpytest_inprocess("--pdb", p)

0 commit comments

Comments
 (0)