Remove dangerous sys.path manipulations in test_pluginmanager

Noticed these while working in something else
This commit is contained in:
Bruno Oliveira 2018-08-25 17:33:29 -03:00
parent be4b359c74
commit f872fcb5d0
1 changed files with 1 additions and 3 deletions

View File

@ -25,7 +25,6 @@ class TestPytestPluginInteractions(object):
)
conf = testdir.makeconftest(
"""
import sys ; sys.path.insert(0, '.')
import newhooks
def pytest_addhooks(pluginmanager):
pluginmanager.addhooks(newhooks)
@ -263,8 +262,7 @@ class TestPytestPluginManager(object):
mod.pytest_plugins = "pytest_a"
aplugin = testdir.makepyfile(pytest_a="#")
reprec = testdir.make_hook_recorder(pytestpm)
# syspath.prepend(aplugin.dirpath())
sys.path.insert(0, str(aplugin.dirpath()))
testdir.syspathinsert(aplugin.dirpath())
pytestpm.consider_module(mod)
call = reprec.getcall(pytestpm.hook.pytest_plugin_registered.name)
assert call.plugin.__name__ == "pytest_a"