@@ -1021,6 +1021,10 @@ def test_env_finds_the_correct_executables_for_generic_env(tmp_dir, manager):
1021
1021
sys .version_info [0 ], sys .version_info [1 ], ".exe" if WINDOWS else ""
1022
1022
)
1023
1023
1024
+ if WINDOWS :
1025
+ expected_executable = "python.exe"
1026
+ expected_pip_executable = "pip.exe"
1027
+
1024
1028
assert Path (venv .python ).name == expected_executable
1025
1029
assert Path (venv .pip ).name == expected_pip_executable
1026
1030
@@ -1046,13 +1050,15 @@ def test_env_finds_fallback_executables_for_generic_env(tmp_dir, manager):
1046
1050
if (
1047
1051
venv ._bin_dir .joinpath (expected_executable ).exists ()
1048
1052
and venv ._bin_dir .joinpath (major_executable ).exists ()
1053
+ or not venv ._bin_dir .joinpath (expected_executable ).exists ()
1049
1054
):
1050
1055
venv ._bin_dir .joinpath (expected_executable ).unlink ()
1051
1056
expected_executable = major_executable
1052
1057
1053
1058
if (
1054
1059
venv ._bin_dir .joinpath (expected_executable ).exists ()
1055
1060
and venv ._bin_dir .joinpath (default_executable ).exists ()
1061
+ or not venv ._bin_dir .joinpath (expected_executable ).exists ()
1056
1062
):
1057
1063
venv ._bin_dir .joinpath (expected_executable ).unlink ()
1058
1064
expected_executable = default_executable
@@ -1079,6 +1085,12 @@ def test_env_finds_fallback_executables_for_generic_env(tmp_dir, manager):
1079
1085
venv ._bin_dir .joinpath (expected_pip_executable ).unlink ()
1080
1086
expected_pip_executable = default_pip_executable
1081
1087
1088
+ if not venv ._bin_dir .joinpath (expected_executable ).exists ():
1089
+ expected_pip_executable = default_executable
1090
+
1091
+ if not venv ._bin_dir .joinpath (expected_pip_executable ).exists ():
1092
+ expected_pip_executable = default_pip_executable
1093
+
1082
1094
venv = GenericEnv (parent_venv .path , child_env = VirtualEnv (child_venv_path ))
1083
1095
1084
1096
assert Path (venv .python ).name == expected_executable
0 commit comments