Tools: fix flake8 issue

This commit is contained in:
Pierre Kancir 2023-10-19 23:11:17 +02:00 committed by Peter Barker
parent 63a836e013
commit c1c730a9bb
1 changed files with 4 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import time
import traceback
from datetime import datetime
from typing import List
import importlib.util
import pexpect
import fnmatch
@ -1549,7 +1550,9 @@ class TestSuite(ABC):
self.generate_junit = generate_junit
if generate_junit:
try:
import junitparser
spec = importlib.util.find_spec("junitparser")
if spec is None:
raise ImportError
except ImportError as e:
raise ImportError(f"Junit export need junitparser package.\n {e} \nTry: python -m pip install junitparser")