Skip to content

Commit 0d3ae1f

Browse files
committed
fix the tests, maybe
1 parent 7deaec9 commit 0d3ae1f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/utils/env/test_env_manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def check_output(cmd: list[str], *args: Any, **kwargs: Any) -> str:
6969
return f"/usr/bin/{basename}"
7070

7171
if "print(sys.base_prefix)" in python_cmd:
72-
return "/usr"
72+
return sys.base_prefix
7373

7474
assert "import sys; print(sys.prefix)" in python_cmd
7575
return "/prefix"
@@ -967,7 +967,7 @@ def test_create_venv_tries_to_find_a_compatible_python_executable_using_specific
967967
mocker.patch(
968968
"subprocess.check_output",
969969
side_effect=[
970-
"/usr",
970+
sys.base_prefix,
971971
"/usr/bin/python3",
972972
"3.5.3",
973973
"/usr/bin/python3.9",
@@ -997,7 +997,7 @@ def test_create_venv_fails_if_no_compatible_python_version_could_be_found(
997997

998998
poetry.package.python_versions = "^4.8"
999999

1000-
mocker.patch("subprocess.check_output", side_effect=["/usr"])
1000+
mocker.patch("subprocess.check_output", side_effect=[sys.base_prefix])
10011001
m = mocker.patch(
10021002
"poetry.utils.env.EnvManager.build_venv", side_effect=lambda *args, **kwargs: ""
10031003
)
@@ -1023,7 +1023,7 @@ def test_create_venv_does_not_try_to_find_compatible_versions_with_executable(
10231023

10241024
poetry.package.python_versions = "^4.8"
10251025

1026-
mocker.patch("subprocess.check_output", side_effect=["/usr", "3.8.0"])
1026+
mocker.patch("subprocess.check_output", side_effect=[sys.base_prefix, "3.8.0"])
10271027
m = mocker.patch(
10281028
"poetry.utils.env.EnvManager.build_venv", side_effect=lambda *args, **kwargs: ""
10291029
)

0 commit comments

Comments
 (0)