Commit 0365e72b by Vladimir Berkutov Committed by GitHub

Fix test_env.py in environments with symlinks (#4624)

test_env_shell_commands_with_stdinput_in_their_arg_work_as_expected contains path comparison which does not take into account potential symlinks.
When testing under MacOS and brew-installed python, venv version points to a path with symlink while python outputs the resolved path.
parent 089ff9dd
......@@ -92,9 +92,11 @@ def test_env_shell_commands_with_stdinput_in_their_arg_work_as_expected(
venv_path = Path(tmp_dir) / "Virtual Env"
manager.build_venv(str(venv_path))
venv = VirtualEnv(venv_path)
assert venv.run("python", "-", input_=GET_BASE_PREFIX, shell=True).strip() == str(
venv.get_base_prefix()
run_output_path = Path(
venv.run("python", "-", input_=GET_BASE_PREFIX, shell=True).strip()
)
venv_base_prefix_path = Path(str(venv.get_base_prefix()))
assert run_output_path.resolve() == venv_base_prefix_path.resolve()
@pytest.fixture
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment