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