diff --git a/tests/integration/standard/test_connection.py b/tests/integration/standard/test_connection.py index b86a4445af..935df1605e 100644 --- a/tests/integration/standard/test_connection.py +++ b/tests/integration/standard/test_connection.py @@ -213,7 +213,7 @@ def get_connection(self, timeout=5): automated testing edge-case. """ conn = None - e = None + err = None for i in range(5): try: contact_point = CASSANDRA_IP @@ -225,12 +225,14 @@ def get_connection(self, timeout=5): ) break except (OperationTimedOut, NoHostAvailable, ConnectionShutdown) as e: + err = e continue if conn: return conn - else: - raise e + if err: + raise err + raise RuntimeError("Unexpected state, nor conn neither err is populated, most likely self.klass.factory returned None") def test_single_connection(self): """