Skip to content

Commit 2f058ad

Browse files
committed
test_cmdline_python_package_symlink: match sys.path and PYTHONPATH
1 parent 21cd496 commit 2f058ad

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

testing/acceptance_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,6 @@ def test_cmdline_python_package_symlink(self, testdir, monkeypatch):
688688
pytest.skip(six.text_type(e.args[0]))
689689
monkeypatch.delenv("PYTHONDONTWRITEBYTECODE", raising=False)
690690

691-
search_path = ["lib", os.path.join("local", "lib")]
692-
693691
dirname = "lib"
694692
d = testdir.mkdir(dirname)
695693
foo = d.mkdir("foo")
@@ -728,8 +726,9 @@ def join_pythonpath(*dirs):
728726
dirs += (cur,)
729727
return os.pathsep.join(str(p) for p in dirs)
730728

729+
search_path = ["lib", os.path.join("local", "lib")]
731730
monkeypatch.setenv("PYTHONPATH", join_pythonpath(*search_path))
732-
for p in search_path:
731+
for p in reversed(search_path):
733732
monkeypatch.syspath_prepend(p)
734733

735734
# module picked up in symlink-ed directory:

0 commit comments

Comments
 (0)