Skip to content

Commit b359b21

Browse files
committed
fix(pylint): workarounds for pylint issues
1 parent 11aea9e commit b359b21

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

tests/test_frontend_tkinter_template_overview.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
from ardupilot_methodic_configurator.backend_filesystem_vehicle_components import VehicleComponents
2323
from ardupilot_methodic_configurator.frontend_tkinter_template_overview import TemplateOverviewWindow, argument_parser, main
2424

25-
# pylint: disable=unused-argument,protected-access
25+
# pylint: disable=useless-suppression
26+
# pylint: disable=unused-argument,protected-access,invalid-name
27+
# pylint: enable=useless-suppression
2628
# ruff: noqa: ARG001
2729

2830

@@ -401,8 +403,8 @@ def test_tree_bindings(self, mock_vehicle_components, mock_toplevel) -> None:
401403
window.tree = MagicMock()
402404

403405
# Create mocks for the private methods using the correct name mangling format
404-
window._TemplateOverviewWindow__on_row_selection_change = MagicMock() # pylint: disable=invalid-name
405-
window._TemplateOverviewWindow__on_row_double_click = MagicMock() # pylint: disable=invalid-name
406+
window._TemplateOverviewWindow__on_row_selection_change = MagicMock()
407+
window._TemplateOverviewWindow__on_row_double_click = MagicMock()
406408

407409
# Manually call the binding code
408410
window.tree.bind("<ButtonRelease-1>", window._TemplateOverviewWindow__on_row_selection_change)
@@ -434,7 +436,7 @@ def test_column_heading_command(mock_vehicle_components, mock_toplevel) -> None:
434436
window.tree["columns"] = ["col1", "col2"]
435437

436438
# Create a mock for __sort_by_column that we can track
437-
window._TemplateOverviewWindow__sort_by_column = MagicMock() # pylint: disable=invalid-name
439+
window._TemplateOverviewWindow__sort_by_column = MagicMock()
438440

439441
# Directly call heading for each column instead of using a loop
440442
window.tree.heading(
@@ -797,7 +799,7 @@ def safe_after(ms, func) -> None:
797799
window.root.after.side_effect = safe_after
798800

799801
# Create a mock update_selection that raises an exception
800-
window._TemplateOverviewWindow__update_selection = MagicMock(side_effect=Exception("Test exception")) # pylint: disable=invalid-name
802+
window._TemplateOverviewWindow__update_selection = MagicMock(side_effect=Exception("Test exception"))
801803

802804
# Call the method
803805
window._TemplateOverviewWindow__on_row_selection_change(mock_event)

0 commit comments

Comments
 (0)