Skip to content

Commit b64f3ea

Browse files
committed
testing/conftest.py: testdir: set PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
Fixes pytest-dev#4518.
1 parent d0ff28d commit b64f3ea

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

testing/conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import sys
33

44
import pytest
5+
from _pytest.pytester import Testdir
56

67

78
def pytest_addoption(parser):
@@ -152,3 +153,9 @@ def runtest(self):
152153
"""
153154
)
154155
testdir.makefile(".yaml", test1="")
156+
157+
158+
@pytest.fixture
159+
def testdir(testdir: Testdir) -> Testdir:
160+
testdir.monkeypatch.setenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", "1")
161+
return testdir

testing/test_junitxml.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,7 @@ def test_pass():
12261226

12271227

12281228
def test_runs_twice_xdist(testdir, run_and_parse):
1229+
testdir.monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD")
12291230
pytest.importorskip("xdist")
12301231
testdir.monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD")
12311232
f = testdir.makepyfile(

testing/test_terminal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ def test_verbose_reporting(self, verbose_testfile, testdir):
714714
assert result.ret == 1
715715

716716
def test_verbose_reporting_xdist(self, verbose_testfile, testdir, pytestconfig):
717+
testdir.monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD")
717718
if not pytestconfig.pluginmanager.get_plugin("xdist"):
718719
pytest.skip("xdist plugin not installed")
719720

0 commit comments

Comments
 (0)