Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions testing/acceptance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,6 @@ def test_cmdline_python_package_symlink(self, testdir, monkeypatch):
pytest.skip(six.text_type(e.args[0]))
monkeypatch.delenv("PYTHONDONTWRITEBYTECODE", raising=False)

search_path = ["lib", os.path.join("local", "lib")]

dirname = "lib"
d = testdir.mkdir(dirname)
foo = d.mkdir("foo")
Expand Down Expand Up @@ -728,8 +726,9 @@ def join_pythonpath(*dirs):
dirs += (cur,)
return os.pathsep.join(str(p) for p in dirs)

search_path = ["lib", os.path.join("local", "lib")]
monkeypatch.setenv("PYTHONPATH", join_pythonpath(*search_path))
for p in search_path:
for p in reversed(search_path):
monkeypatch.syspath_prepend(p)

# module picked up in symlink-ed directory:
Expand All @@ -738,8 +737,8 @@ def join_pythonpath(*dirs):
assert result.ret == 0
result.stdout.fnmatch_lines(
[
"*lib/foo/bar/test_bar.py::test_bar*PASSED*",
"*lib/foo/bar/test_bar.py::test_other*PASSED*",
"*lib/foo/bar/test_bar.py::test_bar PASSED*",
"*lib/foo/bar/test_bar.py::test_other PASSED*",
"*2 passed*",
]
)
Expand Down