Only do abrupt exit on CI

This commit is contained in:
Kovid Goyal 2023-10-17 06:49:22 +05:30
parent 0ca3b990dc
commit 22c95c901e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -330,9 +330,13 @@ def run_test(test_name, verbosity=4, buffer=False):
def run_cli(suite, verbosity=4, buffer=True):
r = unittest.TextTestRunner
# r.resultclass = unittest.TextTestResult if verbosity < 2 else TestResult
r.resultclass = unittest.TextTestResult if verbosity < 2 else TestResult
init_env()
result = r(verbosity=verbosity, buffer=buffer and not is_ci).run(suite)
print(111111111, result, flush=True)
rc = 0 if result.wasSuccessful() else 1
os._exit(rc)
if is_ci:
# for some reason interpreter shutdown hangs probably some non-daemonic
# thread
os._exit(rc)
else:
raise SystemExit(rc)