Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/_pytest/pytester.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,11 @@ def __init__(self, request, tmpdir_factory):

# Environment (updates) for inner runs.
tmphome = str(self.tmpdir)
self._env_run_update = {"HOME": tmphome, "USERPROFILE": tmphome}
self._env_run_update = {
"HOME": tmphome,
"USERPROFILE": tmphome,
"PYTEST_DISABLE_PLUGIN_AUTOLOAD": "1",
}

def __repr__(self):
return "<Testdir {!r}>".format(self.tmpdir)
Expand Down
2 changes: 2 additions & 0 deletions testing/acceptance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ def test_option(pytestconfig):

@pytest.mark.parametrize("load_cov_early", [True, False])
def test_early_load_setuptools_name(self, testdir, monkeypatch, load_cov_early):
del testdir._env_run_update["PYTEST_DISABLE_PLUGIN_AUTOLOAD"]

testdir.makepyfile(mytestplugin1_module="")
testdir.makepyfile(mytestplugin2_module="")
testdir.makepyfile(mycov_module="")
Expand Down
1 change: 1 addition & 0 deletions testing/test_helpconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@


def test_version(testdir, pytestconfig):
del testdir._env_run_update["PYTEST_DISABLE_PLUGIN_AUTOLOAD"]
result = testdir.runpytest("--version")
assert result.ret == 0
# p = py.path.local(py.__file__).dirpath()
Expand Down
1 change: 1 addition & 0 deletions testing/test_junitxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,7 @@ def test_pass():

def test_runs_twice_xdist(testdir, run_and_parse):
pytest.importorskip("xdist")
del testdir._env_run_update["PYTEST_DISABLE_PLUGIN_AUTOLOAD"]
f = testdir.makepyfile(
"""
def test_pass():
Expand Down
2 changes: 2 additions & 0 deletions testing/test_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ def test_method(self):
assert result.ret == 0

def test_header_trailer_info(self, testdir, request):
del testdir._env_run_update["PYTEST_DISABLE_PLUGIN_AUTOLOAD"]
testdir.makepyfile(
"""
def test_passes():
Expand Down Expand Up @@ -705,6 +706,7 @@ def test_verbose_reporting_xdist(self, verbose_testfile, testdir, pytestconfig):
if not pytestconfig.pluginmanager.get_plugin("xdist"):
pytest.skip("xdist plugin not installed")

del testdir._env_run_update["PYTEST_DISABLE_PLUGIN_AUTOLOAD"]
result = testdir.runpytest(
verbose_testfile, "-v", "-n 1", "-Walways::pytest.PytestWarning"
)
Expand Down