-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
pytester: use temporary HOME with spawn #5306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8a41b82
to
5e5e2f3
Compare
Refactored it, which also allows for adjusting it via |
This would allow for the following now, which works around pdb++ hijacking pdb and adding source code highlighting, which fails some (3) tests currently. Not sure if it should be added though, given that it is rather specific (pdbpp being installed), and tests could be adjusted to cope with it (i.e. loser/other assertions). diff --git i/testing/test_pdb.py w/testing/test_pdb.py
index c0ba7159b..81e455b13 100644
--- i/testing/test_pdb.py
+++ w/testing/test_pdb.py
@@ -76,6 +76,13 @@ def set_trace(self, frame):
del _pytest._CustomDebugger
+@pytest.fixture(autouse=True)
+def pdb_env(request):
+ if "testdir" in request.funcargnames:
+ testdir = request.getfixturevalue("testdir")
+ testdir._env_run_update["PDBPP_HIJACK_PDB"] = "0"
+
+
class TestPDB(object):
@pytest.fixture
def pdblist(self, request): |
Note that the above fixture is different from setting |
I'm fine if this helps people with pdb++ installed to run the pytest suite (such as yourself), just please make sure to add an informative docstring to the fixture though. Also feel free to merge this now if you prefer to introduce this fixture in a future PR instead. |
For pytest-dev#5306 I would have to add `testing/test_pytester.py` to the default pos args, but that would run all other tests therein additionally. This also adds pexpect tests to the MacOS job, which appears to have caused trouble at least in the past, and likely needs fixing here before this works.
Test was skipped - needs #5313. |
For pytest-dev#5306 I would have to add `testing/test_pytester.py` to the default pos args, but that would run all other tests therein additionally. This also adds pexpect tests to the MacOS job, which appears to have caused trouble at least in the past, and likely needs fixing here before this works.
For pytest-dev#5306 I would have to add `testing/test_pytester.py` to the default pos args, but that would run all other tests therein additionally. This also adds pexpect tests to the MacOS job, which appears to have caused trouble at least in the past, and likely needs fixing here before this works.
Followup to #4956.