From 5f59d1b8b76a66a5b31b787b6fd5edb8280bf587 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 22 Jun 2016 12:44:08 +0530 Subject: [PATCH] Exit code should be 1 when some tests fail --- src/calibre/utils/run_tests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/utils/run_tests.py b/src/calibre/utils/run_tests.py index a9448360ff..f5be1daa12 100644 --- a/src/calibre/utils/run_tests.py +++ b/src/calibre/utils/run_tests.py @@ -120,4 +120,6 @@ def run_cli(suite, verbosity=4): r = unittest.TextTestRunner r.resultclass = unittest.TextTestResult if verbosity < 2 else TestResult init_env() - r(verbosity=verbosity).run(suite) + result = r(verbosity=verbosity).run(suite) + if not result.wasSuccessful(): + raise SystemExit(1)