@@ -300,8 +300,7 @@ def test_shim_resolved_to_real_binary(
300300 with patch ("py_discovery._builtin.PathPythonInfo.from_exe" ) as mock_from_exe :
301301 mock_from_exe .return_value = None
302302 get_interpreter ("python2.7" , [])
303- mock_from_exe .assert_called_once ()
304- assert mock_from_exe .call_args [0 ][0 ] == str (real_binary )
303+ assert mock_from_exe .call_args_list [0 ][0 ][0 ] == str (real_binary )
305304
306305
307306def test_shim_not_resolved_without_version_manager_env (tmp_path : Path , monkeypatch : pytest .MonkeyPatch ) -> None :
@@ -318,8 +317,7 @@ def test_shim_not_resolved_without_version_manager_env(tmp_path: Path, monkeypat
318317 with patch ("py_discovery._builtin.PathPythonInfo.from_exe" ) as mock_from_exe :
319318 mock_from_exe .return_value = None
320319 get_interpreter ("python2.7" , [])
321- mock_from_exe .assert_called_once ()
322- assert mock_from_exe .call_args [0 ][0 ] == str (shim )
320+ assert mock_from_exe .call_args_list [0 ][0 ][0 ] == str (shim )
323321
324322
325323def test_shim_falls_through_when_binary_missing (tmp_path : Path , monkeypatch : pytest .MonkeyPatch ) -> None :
@@ -334,8 +332,7 @@ def test_shim_falls_through_when_binary_missing(tmp_path: Path, monkeypatch: pyt
334332 with patch ("py_discovery._builtin.PathPythonInfo.from_exe" ) as mock_from_exe :
335333 mock_from_exe .return_value = None
336334 get_interpreter ("python2.7" , [])
337- mock_from_exe .assert_called_once ()
338- assert mock_from_exe .call_args [0 ][0 ] == str (shim )
335+ assert mock_from_exe .call_args_list [0 ][0 ][0 ] == str (shim )
339336
340337
341338def test_shim_uses_python_version_file (tmp_path : Path , monkeypatch : pytest .MonkeyPatch ) -> None :
@@ -353,8 +350,7 @@ def test_shim_uses_python_version_file(tmp_path: Path, monkeypatch: pytest.Monke
353350 with patch ("py_discovery._builtin.PathPythonInfo.from_exe" ) as mock_from_exe :
354351 mock_from_exe .return_value = None
355352 get_interpreter ("python2.7" , [])
356- mock_from_exe .assert_called_once ()
357- assert mock_from_exe .call_args [0 ][0 ] == str (real_binary )
353+ assert mock_from_exe .call_args_list [0 ][0 ][0 ] == str (real_binary )
358354
359355
360356def test_shim_pyenv_version_env_takes_priority_over_file (tmp_path : Path , monkeypatch : pytest .MonkeyPatch ) -> None :
@@ -373,8 +369,7 @@ def test_shim_pyenv_version_env_takes_priority_over_file(tmp_path: Path, monkeyp
373369 with patch ("py_discovery._builtin.PathPythonInfo.from_exe" ) as mock_from_exe :
374370 mock_from_exe .return_value = None
375371 get_interpreter ("python2.7" , [])
376- mock_from_exe .assert_called_once ()
377- assert mock_from_exe .call_args [0 ][0 ] == str (env_binary )
372+ assert mock_from_exe .call_args_list [0 ][0 ][0 ] == str (env_binary )
378373
379374
380375def test_shim_uses_global_version_file (tmp_path : Path , monkeypatch : pytest .MonkeyPatch ) -> None :
@@ -394,8 +389,7 @@ def test_shim_uses_global_version_file(tmp_path: Path, monkeypatch: pytest.Monke
394389 with patch ("py_discovery._builtin.PathPythonInfo.from_exe" ) as mock_from_exe :
395390 mock_from_exe .return_value = None
396391 get_interpreter ("python2.7" , [])
397- mock_from_exe .assert_called_once ()
398- assert mock_from_exe .call_args [0 ][0 ] == str (real_binary )
392+ assert mock_from_exe .call_args_list [0 ][0 ][0 ] == str (real_binary )
399393
400394
401395def test_shim_colon_separated_pyenv_version_picks_first_match (
@@ -415,5 +409,4 @@ def test_shim_colon_separated_pyenv_version_picks_first_match(
415409 with patch ("py_discovery._builtin.PathPythonInfo.from_exe" ) as mock_from_exe :
416410 mock_from_exe .return_value = None
417411 get_interpreter ("python2.7" , [])
418- mock_from_exe .assert_called_once ()
419- assert mock_from_exe .call_args [0 ][0 ] == str (second_binary )
412+ assert mock_from_exe .call_args_list [0 ][0 ][0 ] == str (second_binary )
0 commit comments