@patch('os.path.exists')
def test_resolve_interpreter_with_invalid_interpreter(mock_exists):
 mock_exists.return_value = True
 virtualenv.is_executable = Mock(return_value=False)
 invalid = os.path.abspath('/usr/bin/pyt_hon53')
 with pytest.raises(SystemExit):
  virtualenv.resolve_interpreter(invalid)
 mock_exists.assert_called_with(invalid)
 virtualenv.is_executable.assert_called_with(invalid)

@ patch ( 'os.path.exists' ) def test_resolve_interpreter_with_invalid_interpreter ( mock_exists ) : mock_exists . return_value = True virtualenv . is_executable = Mock ( return_value = False ) invalid = os . path . abspath ( '/usr/bin/pyt_hon53' ) with pytest . raises ( SystemExit ) : virtualenv . resolve_interpreter ( invalid ) mock_exists . assert_called_with ( invalid ) virtualenv . is_executable . assert_called_with ( invalid )
should exit when with absolute path if not exists .