diff --git a/api/src/opentrons/hardware_control/controller.py b/api/src/opentrons/hardware_control/controller.py index a28bfa6230c..20b4aa1c622 100644 --- a/api/src/opentrons/hardware_control/controller.py +++ b/api/src/opentrons/hardware_control/controller.py @@ -7,7 +7,7 @@ from typing_extensions import Final try: import aionotify # type: ignore -except OSError: +except (OSError, ModuleNotFoundError): aionotify = None # type: ignore from opentrons.drivers.smoothie_drivers import driver_3_0 diff --git a/api/tests/opentrons/conftest.py b/api/tests/opentrons/conftest.py index 4e476654daa..f0f4e56bf06 100755 --- a/api/tests/opentrons/conftest.py +++ b/api/tests/opentrons/conftest.py @@ -9,7 +9,7 @@ try: import aionotify -except OSError: +except (OSError, ModuleNotFoundError): aionotify = None # type: ignore import asyncio import os diff --git a/api/tests/opentrons/hardware_control/test_instruments.py b/api/tests/opentrons/hardware_control/test_instruments.py index 2e00e9841fa..cd358c3edf6 100644 --- a/api/tests/opentrons/hardware_control/test_instruments.py +++ b/api/tests/opentrons/hardware_control/test_instruments.py @@ -2,7 +2,7 @@ from unittest import mock try: import aionotify -except OSError: +except (OSError, ModuleNotFoundError): aionotify = None # type: ignore import pytest import typeguard diff --git a/api/tests/opentrons/hardware_control/test_modules.py b/api/tests/opentrons/hardware_control/test_modules.py index 406f373bad1..ecf15f79fbf 100644 --- a/api/tests/opentrons/hardware_control/test_modules.py +++ b/api/tests/opentrons/hardware_control/test_modules.py @@ -2,10 +2,6 @@ from pathlib import Path from unittest import mock import pytest -try: - import aionotify -except OSError: - aionotify = None # type: ignore from opentrons.hardware_control import ExecutionManager from opentrons.hardware_control.modules import ModuleAtPort from opentrons.hardware_control.modules.types import (