tests: fix tests that require PYTEST_DISABLE_PLUGIN_AUTOLOAD to be unset

Fix pytest's own tests with PYTEST_DISABLE_PLUGIN_AUTOLOAD=1.
This commit is contained in:
Daniel Hahler
2018-12-09 11:53:41 +01:00
parent 818aa4d343
commit 64ee1ee81b
4 changed files with 15 additions and 6 deletions

View File

@@ -153,7 +153,8 @@ class TestImportHookInstallation(object):
@pytest.mark.parametrize("mode", ["plain", "rewrite"])
@pytest.mark.parametrize("plugin_state", ["development", "installed"])
def test_installed_plugin_rewrite(self, testdir, mode, plugin_state):
def test_installed_plugin_rewrite(self, testdir, mode, plugin_state, monkeypatch):
monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
# Make sure the hook is installed early enough so that plugins
# installed via setuptools are rewritten.
testdir.tmpdir.join("hampkg").ensure(dir=1)