mirror of
https://github.com/zulip/zulip.git
synced 2025-10-26 01:24:02 +00:00
test_runner: Cleanup typing for TestResult objects.
There's two possible types here.
This commit is contained in:
@@ -96,12 +96,14 @@ def report_slow_tests() -> None:
|
||||
print(' This may no longer be true: %s' % (slowness_reason,))
|
||||
|
||||
def enforce_timely_test_completion(test_method: Any, test_name: str,
|
||||
delay: float, result: "TextTestResult") -> None:
|
||||
delay: float, result: unittest.TestResult) -> None:
|
||||
if hasattr(test_method, 'slowness_reason'):
|
||||
max_delay = 2.0 # seconds
|
||||
else:
|
||||
max_delay = 0.4 # seconds
|
||||
|
||||
assert isinstance(result, TextTestResult) or isinstance(result, RemoteTestResult)
|
||||
|
||||
if delay > max_delay:
|
||||
msg = '** Test is TOO slow: %s (%.3f s)\n' % (test_name, delay)
|
||||
result.addInfo(test_method, msg)
|
||||
|
||||
Reference in New Issue
Block a user