Skip to content

Commit 44432be

Browse files
authored
Disable plugin autoloading in the test suite (#49)
1 parent fec7a49 commit 44432be

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/test_env.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,15 @@ def test_env(
104104
Path(str(tmp_dir / f"test_{test_name}.py")).symlink_to(Path(__file__).parent / "template.py")
105105
(tmp_dir / "pytest.ini").write_text(ini, encoding="utf-8")
106106

107+
new_env = {
108+
**env,
109+
"_TEST_ENV": repr(expected_env),
110+
"PYTEST_DISABLE_PLUGIN_AUTOLOAD": "1",
111+
"PYTEST_PLUGINS": "pytest_env.plugin",
112+
}
113+
107114
# monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict
108-
with mock.patch.dict(os.environ, {**env, "_TEST_ENV": repr(expected_env)}, clear=True):
115+
with mock.patch.dict(os.environ, new_env, clear=True):
109116
result = testdir.runpytest()
110117

111118
result.assert_outcomes(passed=1)

0 commit comments

Comments
 (0)