test: fix the exception check for the missing eiproto module

When running pytest from the source directory we get a
ModuleNotFoundError, not an ImportError.
This commit is contained in:
Peter Hutterer 2023-04-06 11:57:12 +10:00
parent 0aa8bab9c0
commit 6179c91580

View file

@ -46,9 +46,12 @@ try:
EiDevice,
EiSeat,
)
except ImportError:
except ModuleNotFoundError as e:
# This file needs to be processed by meson, so let's skip when this fails in the source dir
pytest.skip(allow_module_level=True)
if e.name == "eiproto":
pytest.skip(allow_module_level=True)
else:
raise e
logger = structlog.get_logger()