Merge pull request #5992 from blueyed/tests-PDBPP_HIJACK_PDB

tests: debugging: disable pdb++ within inner tests
This commit is contained in:
Daniel Hahler 2019-10-18 17:50:03 +02:00 committed by GitHub
commit 0783030357
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -17,6 +17,14 @@ else:
_ENVIRON_PYTHONBREAKPOINT = os.environ.get("PYTHONBREAKPOINT", "")
@pytest.fixture(autouse=True)
def pdb_env(request):
if "testdir" in request.fixturenames:
# Disable pdb++ with inner tests.
testdir = request.getfixturevalue("testdir")
testdir._env_run_update["PDBPP_HIJACK_PDB"] = "0"
def runpdb_and_get_report(testdir, source):
p = testdir.makepyfile(source)
result = testdir.runpytest_inprocess("--pdb", p)