diff --git a/frappe/commands/testing.py b/frappe/commands/testing.py index df20556ff6..2be1d12153 100644 --- a/frappe/commands/testing.py +++ b/frappe/commands/testing.py @@ -197,7 +197,9 @@ def run_tests_in_light_mode(test_params): frappe.clear_cache() suite = FrappeTestLoader().discover_tests(test_params) - unittest.TextTestRunner(failfast=test_params.failfast, resultclass=FrappeTestResult).run(suite) + result = unittest.TextTestRunner(failfast=test_params.failfast, resultclass=FrappeTestResult).run(suite) + if not result.wasSuccessful(): + sys.exit(1) def _setup_xml_output(junit_xml_output):