Skip to content

Commit 788ca28

Browse files
committed
CHORE: pylint fixes
1 parent 7d432f5 commit 788ca28

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

tests/test_middleware_software_updates.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ def test_check_and_update_value_error(self, update_manager) -> None:
5757
latest_release = {"tag_name": "v2.0.0"}
5858
current_version = "1.0.0"
5959

60-
with patch("ardupilot_methodic_configurator.middleware_software_updates.format_version_info", side_effect=ValueError): # noqa: SIM117
61-
with patch("ardupilot_methodic_configurator.middleware_software_updates.logging_error") as mock_logging_error:
62-
assert not update_manager.check_and_update(latest_release, current_version)
63-
mock_logging_error.assert_called_once()
60+
with (
61+
patch(
62+
"ardupilot_methodic_configurator.middleware_software_updates.format_version_info",
63+
side_effect=ValueError,
64+
),
65+
patch("ardupilot_methodic_configurator.middleware_software_updates.logging_error") as mock_logging_error,
66+
):
67+
assert not update_manager.check_and_update(latest_release, current_version)
68+
mock_logging_error.assert_called_once()

update_flight_controller_ids.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Define the base directory to crawl
2020
BASE_DIR = "../ardupilot/libraries/AP_HAL_ChibiOS/hwdef/"
2121

22-
hwdef_dict = dict[str, tuple[int, int, int, str, str, str]]
22+
HwdefDict = dict[str, tuple[int, int, int, str, str, str]]
2323

2424
logging.basicConfig(level="INFO", format="%(asctime)s - %(levelname)s - %(message)s")
2525

@@ -52,8 +52,8 @@ def remove_suffixes(base_dirname: str, suffixes: list) -> str:
5252
return base_dirname
5353

5454

55-
def process_hwdef_files(base_directory: str) -> hwdef_dict:
56-
hwdef_data: hwdef_dict = {}
55+
def process_hwdef_files(base_directory: str) -> HwdefDict:
56+
hwdef_data: HwdefDict = {}
5757

5858
# Walk through the directory
5959
for dirpath, _dirnames, filenames in os.walk(base_directory):
@@ -85,7 +85,7 @@ def process_hwdef_files(base_directory: str) -> hwdef_dict:
8585

8686

8787
def create_dicts( # pylint: disable=too-many-locals
88-
hwdef_data: hwdef_dict,
88+
hwdef_data: HwdefDict,
8989
) -> tuple[dict[int, str], dict[tuple[int, int], str], dict[int, str], dict[int, str], dict[int, str]]:
9090
vid_vendor_dict: dict[int, str] = {}
9191
vid_pid_product_dict: dict[tuple[int, int], str] = {}
@@ -227,7 +227,7 @@ def main() -> None:
227227
apj_board_id_vendor_dict: dict[int, str] = {}
228228
mcu_series_dict: dict[int, str] = {}
229229

230-
hwdef_data: hwdef_dict = process_hwdef_files(BASE_DIR)
230+
hwdef_data: HwdefDict = process_hwdef_files(BASE_DIR)
231231
vid_vendor_dict, vid_pid_product_dict, apj_board_id_name_dict, apj_board_id_vendor_dict, mcu_series_dict = create_dicts(
232232
hwdef_data
233233
)

0 commit comments

Comments
 (0)