def METHOD_NAME(self):
    """Test that the _connect function is not being retried if retry_on_timeout is
    set to False"""
    conn = Connection(retry_on_timeout=False)
    conn._connect = mock.Mock()
    conn._connect.side_effect = socket.timeout
    with pytest.raises(TimeoutError) as e:
        conn.connect()
    assert conn._connect.call_count == 1
    assert str(e.value) == "Timeout connecting to server"
    self.clear(conn)