python: Use isinstance with a tuple for testing multiple types.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-06-23 16:37:14 -07:00
parent aefd8f0de2
commit 8667e632c8
4 changed files with 5 additions and 6 deletions

View File

@@ -102,7 +102,7 @@ def enforce_timely_test_completion(test_method: Callable[..., ReturnT], test_nam
else:
max_delay = 0.4 # seconds
assert isinstance(result, TextTestResult) or isinstance(result, RemoteTestResult)
assert isinstance(result, (TextTestResult, RemoteTestResult))
if delay > max_delay:
msg = f'** Test is TOO slow: {test_name} ({delay:.3f} s)\n'