From 43bd7dbc26c2a797a8c53bacc5d47cee76d31af9 Mon Sep 17 00:00:00 2001 From: Sanniti Date: Thu, 29 Feb 2024 14:07:11 -0500 Subject: [PATCH] remove discountinued loop arg --- api/src/opentrons/hardware_control/modules/update.py | 3 +-- api/tests/opentrons/hardware_control/test_modules.py | 12 +++++------- .../robot_server/service/legacy/routers/modules.py | 1 - .../tests/service/legacy/routers/test_modules.py | 2 -- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/api/src/opentrons/hardware_control/modules/update.py b/api/src/opentrons/hardware_control/modules/update.py index 6f5a5cbe230..51c7d1cd32a 100644 --- a/api/src/opentrons/hardware_control/modules/update.py +++ b/api/src/opentrons/hardware_control/modules/update.py @@ -3,7 +3,7 @@ import os from pathlib import Path from glob import glob -from typing import Any, AsyncGenerator, Dict, Tuple, Optional, Union +from typing import Any, AsyncGenerator, Dict, Tuple, Union from .types import UpdateError from .mod_abc import AbstractModule from opentrons.hardware_control.threaded_async_lock import ThreadedAsyncLock @@ -23,7 +23,6 @@ async def protect_update_transition() -> AsyncGenerator[None, None]: async def update_firmware( module: AbstractModule, firmware_file: Union[str, Path], - loop: Optional[asyncio.AbstractEventLoop], ) -> None: """Apply update of given firmware file to given module. diff --git a/api/tests/opentrons/hardware_control/test_modules.py b/api/tests/opentrons/hardware_control/test_modules.py index f2471bb1bc8..b9c0c7944dd 100644 --- a/api/tests/opentrons/hardware_control/test_modules.py +++ b/api/tests/opentrons/hardware_control/test_modules.py @@ -230,8 +230,6 @@ async def test_module_update_integration( ): from opentrons.hardware_control import modules - loop = asyncio.get_running_loop() - def async_return(result): f = asyncio.Future() f.set_result(result) @@ -255,14 +253,14 @@ async def mock_find_avrdude_bootloader_port(): ) # test temperature module update with avrdude bootloader - await modules.update_firmware(mod_tempdeck, "fake_fw_file_path", loop) + await modules.update_firmware(mod_tempdeck, "fake_fw_file_path") upload_via_avrdude_mock.assert_called_once_with( "ot_module_avrdude_bootloader1", "fake_fw_file_path", bootloader_kwargs ) upload_via_avrdude_mock.reset_mock() # test magnetic module update with avrdude bootloader - await modules.update_firmware(mod_magdeck, "fake_fw_file_path", loop) + await modules.update_firmware(mod_magdeck, "fake_fw_file_path") upload_via_avrdude_mock.assert_called_once_with( "ot_module_avrdude_bootloader1", "fake_fw_file_path", bootloader_kwargs ) @@ -280,7 +278,7 @@ async def mock_find_bossa_bootloader_port(): modules.update, "find_bootloader_port", mock_find_bossa_bootloader_port ) - await modules.update_firmware(mod_thermocycler, "fake_fw_file_path", loop) + await modules.update_firmware(mod_thermocycler, "fake_fw_file_path") upload_via_bossa_mock.assert_called_once_with( "ot_module_bossa_bootloader1", "fake_fw_file_path", bootloader_kwargs ) @@ -298,7 +296,7 @@ async def mock_find_dfu_device_hs(pid: str, expected_device_count: int): monkeypatch.setattr(modules.update, "find_dfu_device", mock_find_dfu_device_hs) - await modules.update_firmware(mod_heatershaker, "fake_fw_file_path", loop) + await modules.update_firmware(mod_heatershaker, "fake_fw_file_path") upload_via_dfu_mock.assert_called_once_with( "df11", "fake_fw_file_path", bootloader_kwargs ) @@ -311,7 +309,7 @@ async def mock_find_dfu_device_tc2(pid: str, expected_device_count: int): monkeypatch.setattr(modules.update, "find_dfu_device", mock_find_dfu_device_tc2) - await modules.update_firmware(mod_thermocycler_gen2, "fake_fw_file_path", loop) + await modules.update_firmware(mod_thermocycler_gen2, "fake_fw_file_path") upload_via_dfu_mock.assert_called_once_with( "df11", "fake_fw_file_path", bootloader_kwargs ) diff --git a/robot-server/robot_server/service/legacy/routers/modules.py b/robot-server/robot_server/service/legacy/routers/modules.py index 71f40f7eee6..ac291479ed3 100644 --- a/robot-server/robot_server/service/legacy/routers/modules.py +++ b/robot-server/robot_server/service/legacy/routers/modules.py @@ -158,7 +158,6 @@ async def post_serial_update( modules.update_firmware( matching_module, matching_module.bundled_fw.path, - asyncio.get_event_loop(), ), 100, ) diff --git a/robot-server/tests/service/legacy/routers/test_modules.py b/robot-server/tests/service/legacy/routers/test_modules.py index e98621e69ed..ca04d0192d9 100644 --- a/robot-server/tests/service/legacy/routers/test_modules.py +++ b/robot-server/tests/service/legacy/routers/test_modules.py @@ -3,7 +3,6 @@ import pytest import asyncio -from decoy import matchers from opentrons.hardware_control import ExecutionManager from opentrons.hardware_control.modules import ( ModuleType, @@ -308,7 +307,6 @@ def test_post_serial_update(api_client, hardware, tempdeck): p.assert_called_once_with( tempdeck, tempdeck._bundled_fw.path, - matchers.IsA(asyncio.AbstractEventLoop), ) body = resp.json()