tests: minor sys.path cleanup
This commit is contained in:
parent
475119988c
commit
05d55b86df
|
@ -34,8 +34,6 @@ class TestModule(object):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_import_prepend_append(self, testdir, monkeypatch):
|
def test_import_prepend_append(self, testdir, monkeypatch):
|
||||||
syspath = list(sys.path)
|
|
||||||
monkeypatch.setattr(sys, "path", syspath)
|
|
||||||
root1 = testdir.mkdir("root1")
|
root1 = testdir.mkdir("root1")
|
||||||
root2 = testdir.mkdir("root2")
|
root2 = testdir.mkdir("root2")
|
||||||
root1.ensure("x456.py")
|
root1.ensure("x456.py")
|
||||||
|
|
|
@ -1335,7 +1335,7 @@ class TestEarlyRewriteBailout(object):
|
||||||
# Setup conditions for py's fspath trying to import pathlib on py34
|
# Setup conditions for py's fspath trying to import pathlib on py34
|
||||||
# always (previously triggered via xdist only).
|
# always (previously triggered via xdist only).
|
||||||
# Ref: https://github.com/pytest-dev/py/pull/207
|
# Ref: https://github.com/pytest-dev/py/pull/207
|
||||||
monkeypatch.setattr(sys, "path", [""] + sys.path)
|
monkeypatch.syspath_prepend("")
|
||||||
monkeypatch.delitem(sys.modules, "pathlib", raising=False)
|
monkeypatch.delitem(sys.modules, "pathlib", raising=False)
|
||||||
|
|
||||||
testdir.makepyfile(
|
testdir.makepyfile(
|
||||||
|
|
Loading…
Reference in New Issue