refactor(tests): Add strict type hints to third batch of test files

This commit is contained in:
2026-02-28 19:16:19 -05:00
parent 579ee8394f
commit e8513d563b
10 changed files with 37 additions and 29 deletions

View File

@@ -1,9 +1,10 @@
import pytest
from unittest.mock import patch, MagicMock
from typing import Any
from gui_2 import App
@pytest.fixture
def app_instance():
def app_instance() -> Any:
# We patch the dependencies of App.__init__ to avoid side effects
with (
patch('gui_2.load_config', return_value={'ai': {}, 'projects': {}}),
@@ -23,7 +24,7 @@ def app_instance():
# Return the app and the mock_pm for use in tests
yield app, mock_pm
def test_mma_dashboard_refresh(app_instance):
def test_mma_dashboard_refresh(app_instance: Any) -> None:
app, mock_pm = app_instance
# 1. Define mock tracks
mock_tracks = [
@@ -43,7 +44,7 @@ def test_mma_dashboard_refresh(app_instance):
# Verify get_all_tracks was called with the correct base_dir
mock_pm.get_all_tracks.assert_called_with(app.ui_files_base_dir)
def test_mma_dashboard_initialization_refresh(app_instance):
def test_mma_dashboard_initialization_refresh(app_instance: Any) -> None:
"""
Checks that _refresh_from_project is called during initialization if
_load_active_project is NOT mocked to skip it (but here it IS mocked in fixture).