Skip to content

Commit 05d55b8

Browse files
committed
tests: minor sys.path cleanup
1 parent 4751199 commit 05d55b8

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

testing/python/collect.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ def test_import_duplicate(self, testdir):
3434
)
3535

3636
def test_import_prepend_append(self, testdir, monkeypatch):
37-
syspath = list(sys.path)
38-
monkeypatch.setattr(sys, "path", syspath)
3937
root1 = testdir.mkdir("root1")
4038
root2 = testdir.mkdir("root2")
4139
root1.ensure("x456.py")

testing/test_assertrewrite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ def test_cwd_changed(self, testdir, monkeypatch):
13351335
# Setup conditions for py's fspath trying to import pathlib on py34
13361336
# always (previously triggered via xdist only).
13371337
# Ref: https://github.com/pytest-dev/py/pull/207
1338-
monkeypatch.setattr(sys, "path", [""] + sys.path)
1338+
monkeypatch.syspath_prepend("")
13391339
monkeypatch.delitem(sys.modules, "pathlib", raising=False)
13401340

13411341
testdir.makepyfile(

0 commit comments

Comments
 (0)