mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Only do abrupt exit on CI
This commit is contained in:
parent
0ca3b990dc
commit
22c95c901e
@ -330,9 +330,13 @@ def run_test(test_name, verbosity=4, buffer=False):
|
|||||||
|
|
||||||
def run_cli(suite, verbosity=4, buffer=True):
|
def run_cli(suite, verbosity=4, buffer=True):
|
||||||
r = unittest.TextTestRunner
|
r = unittest.TextTestRunner
|
||||||
# r.resultclass = unittest.TextTestResult if verbosity < 2 else TestResult
|
r.resultclass = unittest.TextTestResult if verbosity < 2 else TestResult
|
||||||
init_env()
|
init_env()
|
||||||
result = r(verbosity=verbosity, buffer=buffer and not is_ci).run(suite)
|
result = r(verbosity=verbosity, buffer=buffer and not is_ci).run(suite)
|
||||||
print(111111111, result, flush=True)
|
|
||||||
rc = 0 if result.wasSuccessful() else 1
|
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user