sanitycheck: make pyserial optional

We only need pyserial python module if we are doing device testing.
Treat it similar to how we treat tabulate module.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-02-07 17:38:16 -06:00 committed by Kumar Gala
commit b81eec951b

View file

@ -185,7 +185,6 @@ import time
import csv import csv
import yaml import yaml
import glob import glob
import serial
import concurrent import concurrent
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
import logging import logging
@ -195,6 +194,11 @@ from itertools import islice
from pathlib import Path from pathlib import Path
from distutils.spawn import find_executable from distutils.spawn import find_executable
try:
import serial
except ImportError:
print("Install pyserial python module with pip to use --device-testing option.")
try: try:
from anytree import Node, RenderTree, find from anytree import Node, RenderTree, find
except ImportError: except ImportError: