diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index 50078b6757e592..b144db732d6044 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -1549,7 +1549,7 @@ def __init__(self, self.generate_junit = generate_junit if generate_junit: try: - import junitparser + from junitparser import TestCase, TestSuite, JUnitXml, Skipped, Failure except ImportError as e: raise ImportError(f"Junit export need junitparser package.\n {e} \nTry: python -m pip install junitparser") @@ -13511,7 +13511,6 @@ def autotest(self, tests=None, allow_skips=True, step_name=None): def create_junit_report(self, test_name: str, results: List[Result], skip_list: list[tuple[Test, dict[str, str]]]) -> None: """Generate Junit report from the autotest results""" - from junitparser import TestCase, TestSuite, JUnitXml, Skipped, Failure frame = self.vehicleinfo_key() xml_filename = f"autotest_result_{frame}_{test_name}_junit.xml" self.progress(f"Writing test result in jUnit format to {xml_filename}\n")