fix(testing): use XMLTestRunner when junit_xml_output is wanted

This commit is contained in:
AarDG10 2026-04-07 22:10:36 +05:30
parent b80b121f51
commit fe12722e4b

View file

@ -159,11 +159,14 @@ def main(
discover_all_tests(apps, runner) discover_all_tests(apps, runner)
results = [] results = []
global unittest_runner
for app, category, suite in runner.iterRun(): for app, category, suite in runner.iterRun():
click.secho( click.secho(
f"\nRunning {suite.countTestCases()} {category} tests for {app}", fg="cyan", bold=True 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) success = all(r.wasSuccessful() for _, _, r in results)
if not success: if not success: