Skip to content

Commit ab5361f

Browse files
committed
change if stmt logic to be easier to read
1 parent efad63b commit ab5361f

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

test/asynchronous/unified_format.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,10 +1395,8 @@ async def run_scenario(self, spec, uri=None):
13951395
try:
13961396
return await self._run_scenario(spec, uri)
13971397
except (AssertionError, OperationFailure) as exc:
1398-
if not (
1399-
isinstance(exc, OperationFailure)
1400-
and not _IS_SYNC
1401-
and "failpoint" in exc._message
1398+
if isinstance(exc, OperationFailure) and (
1399+
_IS_SYNC or "failpoint" not in exc._message
14021400
):
14031401
raise
14041402
if i < attempts - 1:

test/unified_format.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,10 +1382,8 @@ def run_scenario(self, spec, uri=None):
13821382
try:
13831383
return self._run_scenario(spec, uri)
13841384
except (AssertionError, OperationFailure) as exc:
1385-
if not (
1386-
isinstance(exc, OperationFailure)
1387-
and not _IS_SYNC
1388-
and "failpoint" in exc._message
1385+
if isinstance(exc, OperationFailure) and (
1386+
_IS_SYNC or "failpoint" not in exc._message
13891387
):
13901388
raise
13911389
if i < attempts - 1:

0 commit comments

Comments
 (0)