@@ -89,7 +89,6 @@ def test_uv_python(monkeypatch, tmp_path_factory, mocker):
89
89
monkeypatch .delenv ("XDG_DATA_HOME" , raising = False )
90
90
monkeypatch .setenv ("PATH" , "" )
91
91
mocker .patch .object (PythonInfo , "satisfies" , return_value = False )
92
- python_exe = "python.exe" if IS_WIN else "python"
93
92
94
93
# UV_PYTHON_INSTALL_DIR
95
94
uv_python_install_dir = tmp_path_factory .mktemp ("uv_python_install_dir" )
@@ -101,15 +100,15 @@ def test_uv_python(monkeypatch, tmp_path_factory, mocker):
101
100
102
101
bin_path = uv_python_install_dir .joinpath ("some-py-impl" , "bin" )
103
102
bin_path .mkdir (parents = True )
104
- bin_path .joinpath (python_exe ).touch ()
103
+ bin_path .joinpath ("python" ).touch ()
105
104
get_interpreter ("python" , [])
106
105
mock_from_exe .assert_called_once ()
107
106
assert mock_from_exe .call_args [0 ][0 ] == str (bin_path / "python" )
108
107
109
108
# PATH takes precedence
110
109
mock_from_exe .reset_mock ()
111
110
dir_in_path = tmp_path_factory .mktemp ("path_bin_dir" )
112
- dir_in_path .joinpath (python_exe ).touch ()
111
+ dir_in_path .joinpath ("python.exe" if IS_WIN else "python" ).touch ()
113
112
m .setenv ("PATH" , str (dir_in_path ))
114
113
get_interpreter ("python" , [])
115
114
mock_from_exe .assert_called_once ()
@@ -125,7 +124,7 @@ def test_uv_python(monkeypatch, tmp_path_factory, mocker):
125
124
126
125
bin_path = xdg_data_home .joinpath ("uv" , "python" , "some-py-impl" , "bin" )
127
126
bin_path .mkdir (parents = True )
128
- bin_path .joinpath (python_exe ).touch ()
127
+ bin_path .joinpath ().touch ()
129
128
get_interpreter ("python" , [])
130
129
mock_from_exe .assert_called_once ()
131
130
assert mock_from_exe .call_args [0 ][0 ] == str (bin_path / "python" )
@@ -140,7 +139,7 @@ def test_uv_python(monkeypatch, tmp_path_factory, mocker):
140
139
141
140
bin_path = user_data_path .joinpath ("uv" , "python" , "some-py-impl" , "bin" )
142
141
bin_path .mkdir (parents = True )
143
- bin_path .joinpath (python_exe ).touch ()
142
+ bin_path .joinpath ("python" ).touch ()
144
143
get_interpreter ("python" , [])
145
144
mock_from_exe .assert_called_once ()
146
145
assert mock_from_exe .call_args [0 ][0 ] == str (bin_path / "python" )
0 commit comments