Skip to content

Commit

Permalink
Merge pull request pytest-dev#5992 from blueyed/tests-PDBPP_HIJACK_PDB
Browse files Browse the repository at this point in the history
tests: debugging: disable pdb++ within inner tests
  • Loading branch information
blueyed authored Oct 18, 2019
2 parents d910175 + 7ef4491 commit 0783030
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions testing/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
_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)
Expand Down

0 comments on commit 0783030

Please sign in to comment.