From c6f69700d07f0f672eeefafa2713a57e9255bebd Mon Sep 17 00:00:00 2001 From: Maksim Rakitin Date: Thu, 22 Jul 2021 23:37:13 -0400 Subject: [PATCH 1/2] FIX: ignore missing aionotify more properly --- api/src/opentrons/hardware_control/controller.py | 2 +- api/tests/opentrons/conftest.py | 2 +- api/tests/opentrons/hardware_control/test_instruments.py | 2 +- api/tests/opentrons/hardware_control/test_modules.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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 fa1e0d2b3db..a85c2ac0826 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..6591ef80dee 100644 --- a/api/tests/opentrons/hardware_control/test_modules.py +++ b/api/tests/opentrons/hardware_control/test_modules.py @@ -4,7 +4,7 @@ import pytest try: import aionotify -except OSError: +except (OSError, ModuleNotFoundError): aionotify = None # type: ignore from opentrons.hardware_control import ExecutionManager from opentrons.hardware_control.modules import ModuleAtPort From 5bc890e5b2b2d2170579b188cac761240fa6a4c0 Mon Sep 17 00:00:00 2001 From: Maksim Rakitin Date: Fri, 23 Jul 2021 12:28:39 -0400 Subject: [PATCH 2/2] Remove aionotify import from test_modules.py --- api/tests/opentrons/hardware_control/test_modules.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/api/tests/opentrons/hardware_control/test_modules.py b/api/tests/opentrons/hardware_control/test_modules.py index 6591ef80dee..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, ModuleNotFoundError): - aionotify = None # type: ignore from opentrons.hardware_control import ExecutionManager from opentrons.hardware_control.modules import ModuleAtPort from opentrons.hardware_control.modules.types import (