Skip to content

Commit ee6f9d6

Browse files
committed
simplify redundant error type checking
1 parent c4efbe0 commit ee6f9d6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/integration/long/test_failure_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ def _perform_cql_statement(self, text, consistency_level, expected_exception, se
149149
else:
150150
with self.assertRaises(expected_exception) as cm:
151151
self.execute_helper(session, statement)
152-
if ProtocolVersion.uses_error_code_map(PROTOCOL_VERSION) and (isinstance(cm.exception, WriteFailure) or isinstance(cm.exception, ReadFailure)):
152+
if ProtocolVersion.uses_error_code_map(PROTOCOL_VERSION):
153153
if isinstance(cm.exception, ReadFailure):
154154
self.assertEqual(list(cm.exception.error_code_map.values())[0], 1)
155-
else:
155+
if isinstance(cm.exception, WriteFailure):
156156
self.assertEqual(list(cm.exception.error_code_map.values())[0], 0)
157157

158158
def test_write_failures_from_coordinator(self):

0 commit comments

Comments
 (0)