From 7b811d04906ef10cfbfb72006ba29569321b0323 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 5 Jun 2025 20:10:24 +0530 Subject: [PATCH] refactor: return code for light test runner --- frappe/commands/testing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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):