diff --git a/tests/conftest.py b/tests/conftest.py index 0bef1a7b06a..b2b0eb3487c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -743,7 +743,7 @@ async def hass_supervisor_user( @pytest.fixture async def hass_supervisor_access_token( hass: HomeAssistant, - hass_supervisor_user, + hass_supervisor_user: MockUser, local_auth: homeassistant.HassAuthProvider, ) -> str: """Return a Home Assistant Supervisor access token.""" @@ -836,7 +836,7 @@ def current_request_with_host(current_request: MagicMock) -> None: @pytest.fixture def hass_ws_client( aiohttp_client: ClientSessionGenerator, - hass_access_token: str | None, + hass_access_token: str, hass: HomeAssistant, socket_enabled: None, ) -> WebSocketGenerator: @@ -1372,7 +1372,7 @@ def hass_recorder( enable_migrate_context_ids: bool, enable_migrate_event_type_ids: bool, enable_migrate_entity_ids: bool, - hass_storage, + hass_storage: dict[str, Any], ) -> Generator[Callable[..., HomeAssistant]]: """Home Assistant fixture with in-memory recorder.""" # pylint: disable-next=import-outside-toplevel diff --git a/tests/helpers/test_entity.py b/tests/helpers/test_entity.py index cc53bca8e4d..9d2c9a66a5b 100644 --- a/tests/helpers/test_entity.py +++ b/tests/helpers/test_entity.py @@ -1601,7 +1601,7 @@ async def test_translation_key(hass: HomeAssistant) -> None: assert mock_entity2.translation_key == "from_entity_description" -async def test_repr(hass) -> None: +async def test_repr(hass: HomeAssistant) -> None: """Test Entity.__repr__.""" class MyEntity(MockEntity): diff --git a/tests/helpers/test_frame.py b/tests/helpers/test_frame.py index b0b4a0be6ee..b3fbb0faaf4 100644 --- a/tests/helpers/test_frame.py +++ b/tests/helpers/test_frame.py @@ -32,9 +32,8 @@ async def test_get_integration_logger( assert logger.name == "homeassistant.components.hue" -async def test_extract_frame_resolve_module( - hass: HomeAssistant, enable_custom_integrations -) -> None: +@pytest.mark.usefixtures("enable_custom_integrations") +async def test_extract_frame_resolve_module(hass: HomeAssistant) -> None: """Test extracting the current frame from integration context.""" # pylint: disable-next=import-outside-toplevel from custom_components.test_integration_frame import call_get_integration_frame @@ -50,9 +49,8 @@ async def test_extract_frame_resolve_module( ) -async def test_get_integration_logger_resolve_module( - hass: HomeAssistant, enable_custom_integrations -) -> None: +@pytest.mark.usefixtures("enable_custom_integrations") +async def test_get_integration_logger_resolve_module(hass: HomeAssistant) -> None: """Test getting the logger from integration context.""" # pylint: disable-next=import-outside-toplevel from custom_components.test_integration_frame import call_get_integration_logger diff --git a/tests/test_core.py b/tests/test_core.py index 541affc729b..8be2599f454 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -647,7 +647,9 @@ async def test_stage_shutdown_timeouts(hass: HomeAssistant) -> None: assert hass.state is CoreState.stopped -async def test_stage_shutdown_generic_error(hass: HomeAssistant, caplog) -> None: +async def test_stage_shutdown_generic_error( + hass: HomeAssistant, caplog: pytest.LogCaptureFixture +) -> None: """Simulate a shutdown, test that a generic error at the final stage doesn't prevent it.""" task = asyncio.Future() diff --git a/tests/test_data_entry_flow.py b/tests/test_data_entry_flow.py index cc12ae42b67..c02d909733a 100644 --- a/tests/test_data_entry_flow.py +++ b/tests/test_data_entry_flow.py @@ -556,7 +556,9 @@ async def test_show_progress_hidden_from_frontend(hass: HomeAssistant, manager) assert async_show_progress_done_called -async def test_show_progress_legacy(hass: HomeAssistant, manager, caplog) -> None: +async def test_show_progress_legacy( + hass: HomeAssistant, manager, caplog: pytest.LogCaptureFixture +) -> None: """Test show progress logic. This tests the deprecated version where the config flow is responsible for diff --git a/tests/test_loader.py b/tests/test_loader.py index b195de6006b..8cda75e0321 100644 --- a/tests/test_loader.py +++ b/tests/test_loader.py @@ -1125,7 +1125,10 @@ CUSTOM_ISSUE_TRACKER = "https://blablabla.com" ], ) async def test_async_get_issue_tracker( - hass, domain: str | None, module: str | None, issue_tracker: str | None + hass: HomeAssistant, + domain: str | None, + module: str | None, + issue_tracker: str | None, ) -> None: """Test async_get_issue_tracker.""" mock_integration(hass, MockModule("bla_built_in")) @@ -1187,7 +1190,7 @@ async def test_async_get_issue_tracker( ], ) async def test_async_get_issue_tracker_no_hass( - hass, domain: str | None, module: str | None, issue_tracker: str + hass: HomeAssistant, domain: str | None, module: str | None, issue_tracker: str ) -> None: """Test async_get_issue_tracker.""" mock_integration(hass, MockModule("bla_built_in")) @@ -1220,7 +1223,7 @@ REPORT_CUSTOM_UNKNOWN = "report it to the custom integration author" ], ) async def test_async_suggest_report_issue( - hass, domain: str | None, module: str | None, report_issue: str + hass: HomeAssistant, domain: str | None, module: str | None, report_issue: str ) -> None: """Test async_suggest_report_issue.""" mock_integration(hass, MockModule("bla_built_in")) @@ -1952,7 +1955,8 @@ async def test_integration_warnings( assert "configured to to import its code in the event loop" in caplog.text -async def test_has_services(hass: HomeAssistant, enable_custom_integrations) -> None: +@pytest.mark.usefixtures("enable_custom_integrations") +async def test_has_services(hass: HomeAssistant) -> None: """Test has_services.""" integration = await loader.async_get_integration(hass, "test") assert integration.has_services is False diff --git a/tests/test_setup.py b/tests/test_setup.py index f15fe72603e..910a46d3c73 100644 --- a/tests/test_setup.py +++ b/tests/test_setup.py @@ -1057,7 +1057,7 @@ async def test_async_start_setup_simple_integration_end_to_end( } -async def test_async_get_setup_timings(hass) -> None: +async def test_async_get_setup_timings(hass: HomeAssistant) -> None: """Test we can get the setup timings from the setup time data.""" setup_time = setup._setup_times(hass) # Mock setup time data