Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] tests: harden test_cmdline_python_package_symlink #4106

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions testing/acceptance_test.py
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