Skip to content

Commit f872fcb

Browse files
committed
Remove dangerous sys.path manipulations in test_pluginmanager
Noticed these while working in something else
1 parent be4b359 commit f872fcb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

testing/test_pluginmanager.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def pytest_myhook(xyz):
2525
)
2626
conf = testdir.makeconftest(
2727
"""
28-
import sys ; sys.path.insert(0, '.')
2928
import newhooks
3029
def pytest_addhooks(pluginmanager):
3130
pluginmanager.addhooks(newhooks)
@@ -263,8 +262,7 @@ def test_consider_module_import_module(self, testdir):
263262
mod.pytest_plugins = "pytest_a"
264263
aplugin = testdir.makepyfile(pytest_a="#")
265264
reprec = testdir.make_hook_recorder(pytestpm)
266-
# syspath.prepend(aplugin.dirpath())
267-
sys.path.insert(0, str(aplugin.dirpath()))
265+
testdir.syspathinsert(aplugin.dirpath())
268266
pytestpm.consider_module(mod)
269267
call = reprec.getcall(pytestpm.hook.pytest_plugin_registered.name)
270268
assert call.plugin.__name__ == "pytest_a"

0 commit comments

Comments
 (0)