Remove dangerous sys.path manipulations in test_pluginmanager
Noticed these while working in something else
This commit is contained in:
parent
be4b359c74
commit
f872fcb5d0
|
@ -25,7 +25,6 @@ class TestPytestPluginInteractions(object):
|
||||||
)
|
)
|
||||||
conf = testdir.makeconftest(
|
conf = testdir.makeconftest(
|
||||||
"""
|
"""
|
||||||
import sys ; sys.path.insert(0, '.')
|
|
||||||
import newhooks
|
import newhooks
|
||||||
def pytest_addhooks(pluginmanager):
|
def pytest_addhooks(pluginmanager):
|
||||||
pluginmanager.addhooks(newhooks)
|
pluginmanager.addhooks(newhooks)
|
||||||
|
@ -263,8 +262,7 @@ class TestPytestPluginManager(object):
|
||||||
mod.pytest_plugins = "pytest_a"
|
mod.pytest_plugins = "pytest_a"
|
||||||
aplugin = testdir.makepyfile(pytest_a="#")
|
aplugin = testdir.makepyfile(pytest_a="#")
|
||||||
reprec = testdir.make_hook_recorder(pytestpm)
|
reprec = testdir.make_hook_recorder(pytestpm)
|
||||||
# syspath.prepend(aplugin.dirpath())
|
testdir.syspathinsert(aplugin.dirpath())
|
||||||
sys.path.insert(0, str(aplugin.dirpath()))
|
|
||||||
pytestpm.consider_module(mod)
|
pytestpm.consider_module(mod)
|
||||||
call = reprec.getcall(pytestpm.hook.pytest_plugin_registered.name)
|
call = reprec.getcall(pytestpm.hook.pytest_plugin_registered.name)
|
||||||
assert call.plugin.__name__ == "pytest_a"
|
assert call.plugin.__name__ == "pytest_a"
|
||||||
|
|
Loading…
Reference in New Issue