@@ -50,7 +50,7 @@ def _make_availability_issue(message: str = "issue", config_step: str | None = N
5050 return issue
5151
5252
53- def _make_availability_result (
53+ def _make_availability_result ( # pylint: disable=too-many-arguments
5454 * ,
5555 name : str = "Battery" ,
5656 available : bool = True ,
@@ -266,7 +266,7 @@ def test_ignores_step_info_with_no_urls_at_all(self) -> None:
266266
267267 links = _collect_links (availability_dict , None )
268268
269- assert links == []
269+ assert not links
270270
271271 def test_returns_empty_list_when_no_availability_or_analysis_dicts_given (self ) -> None :
272272 """
@@ -278,7 +278,7 @@ def test_returns_empty_list_when_no_availability_or_analysis_dicts_given(self) -
278278 """
279279 links = _collect_links (None , None )
280280
281- assert links == []
281+ assert not links
282282
283283 def test_ignores_issues_or_outcomes_missing_step_info_key (self ) -> None :
284284 """
@@ -292,7 +292,7 @@ def test_ignores_issues_or_outcomes_missing_step_info_key(self) -> None:
292292
293293 links = _collect_links (availability_dict , None )
294294
295- assert links == []
295+ assert not links
296296
297297
298298class TestFormatComponent :
@@ -324,7 +324,7 @@ def test_skips_empty_manufacturer_and_model(self) -> None:
324324
325325 lines = _format_component (component )
326326
327- assert lines == []
327+ assert not lines
328328
329329 def test_formats_firmware_type_and_version (self ) -> None :
330330 """
@@ -377,7 +377,7 @@ def test_returns_empty_list_for_completely_empty_component(self) -> None:
377377 WHEN: The component is formatted
378378 THEN: The result is an empty list
379379 """
380- assert _format_component ({}) == []
380+ assert not _format_component ({})
381381
382382 def test_ignores_non_dict_connection_like_values (self ) -> None :
383383 """
@@ -391,7 +391,7 @@ def test_ignores_non_dict_connection_like_values(self) -> None:
391391
392392 lines = _format_component (component )
393393
394- assert lines == []
394+ assert not lines
395395
396396
397397@pytest .fixture
@@ -424,7 +424,7 @@ def bare_window() -> LogAnalysisReportWindow:
424424class TestWindowConstruction :
425425 """Cover LogAnalysisReportWindow's full __init__ flow with widgets mocked."""
426426
427- def _build_window (
427+ def _build_window ( # pylint: disable=too-many-arguments
428428 self ,
429429 mocker : MockerFixture ,
430430 patched_widgets : dict [str , MagicMock ],
@@ -434,6 +434,7 @@ def _build_window(
434434 report : dict | None = None ,
435435 vehicle_dir : str = "/vehicle" ,
436436 ) -> LogAnalysisReportWindow :
437+ _ = patched_widgets # Keep the widget patches active while constructing the window.
437438 mocker .patch .object (LogAnalysisReportWindow , "calculate_scaled_geometry" , return_value = "1050x800" )
438439 mocker .patch .object (LogAnalysisReportWindow , "center_window" )
439440 summary = _make_summary (availability_results , analysis_results )
@@ -464,7 +465,7 @@ def test_selector_defaults_to_first_subsystem(self, mocker: MockerFixture, patch
464465 mocker , patched_widgets , [availability_battery , availability_imu ], [analysis_battery , analysis_imu ]
465466 )
466467
467- window .selector .set .assert_called_once_with ("Battery" )
468+ cast ( "MagicMock" , window .selector .set ) .assert_called_once_with ("Battery" )
468469
469470 def test_no_selector_default_when_no_subsystems_present (
470471 self , mocker : MockerFixture , patched_widgets : dict [str , MagicMock ]
@@ -478,15 +479,13 @@ def test_no_selector_default_when_no_subsystems_present(
478479 """
479480 window = self ._build_window (mocker , patched_widgets , [], [])
480481
481- window .selector .set .assert_not_called ()
482+ cast ( "MagicMock" , window .selector .set ) .assert_not_called ()
482483
483484
484485class TestTuningGraphButton :
485486 """Cover the footer's Tuning Parameter Graph button state and click handler."""
486487
487- def test_button_enabled_when_tuning_report_exists (
488- self , mocker : MockerFixture , patched_widgets : dict [str , MagicMock ], tmp_path : Path
489- ) -> None :
488+ def test_button_enabled_when_tuning_report_exists (self , patched_widgets : dict [str , MagicMock ], tmp_path : Path ) -> None :
490489 """
491490 The tuning graph button is enabled when tuning_report.csv exists in the vehicle directory.
492491
@@ -505,9 +504,7 @@ def test_button_enabled_when_tuning_report_exists(
505504 button_mock = patched_widgets ["button" ].return_value
506505 button_mock .configure .assert_any_call (state = "normal" )
507506
508- def test_button_disabled_when_tuning_report_missing (
509- self , mocker : MockerFixture , patched_widgets : dict [str , MagicMock ], tmp_path : Path
510- ) -> None :
507+ def test_button_disabled_when_tuning_report_missing (self , patched_widgets : dict [str , MagicMock ], tmp_path : Path ) -> None :
511508 """
512509 The tuning graph button is disabled when tuning_report.csv is absent.
513510
0 commit comments