From fe12722e4bb110db4651a4612ad62dec19370067 Mon Sep 17 00:00:00 2001 From: AarDG10 Date: Tue, 7 Apr 2026 22:10:36 +0530 Subject: [PATCH] fix(testing): use XMLTestRunner when junit_xml_output is wanted --- frappe/commands/testing.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frappe/commands/testing.py b/frappe/commands/testing.py index 78468b0fd3..394b4c29cf 100644 --- a/frappe/commands/testing.py +++ b/frappe/commands/testing.py @@ -159,11 +159,14 @@ def main( discover_all_tests(apps, runner) results = [] + global unittest_runner for app, category, suite in runner.iterRun(): click.secho( f"\nRunning {suite.countTestCases()} {category} tests for {app}", fg="cyan", bold=True ) - results.append([app, category, runner.run(suite)]) + main_runner = unittest_runner if junit_xml_output and unittest_runner else runner + res = main_runner.run(suite) + results.append([app, category, res]) success = all(r.wasSuccessful() for _, _, r in results) if not success: