From c9acd1711ca86bd8aa4baf3cf6aed5e49766090a Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 4 Jul 2024 10:23:14 +0200 Subject: [PATCH] Improve type hints in gpslogger tests (#121173) --- tests/components/gpslogger/test_init.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/components/gpslogger/test_init.py b/tests/components/gpslogger/test_init.py index 68b95df1702..fab6aaa4e84 100644 --- a/tests/components/gpslogger/test_init.py +++ b/tests/components/gpslogger/test_init.py @@ -45,7 +45,7 @@ async def gpslogger_client( @pytest.fixture(autouse=True) -async def setup_zones(hass): +async def setup_zones(hass: HomeAssistant) -> None: """Set up Zone config in HA.""" assert await async_setup_component( hass, @@ -63,7 +63,7 @@ async def setup_zones(hass): @pytest.fixture -async def webhook_id(hass, gpslogger_client): +async def webhook_id(hass: HomeAssistant, gpslogger_client: TestClient) -> str: """Initialize the GPSLogger component and get the webhook_id.""" await async_process_ha_core_config( hass, @@ -81,7 +81,9 @@ async def webhook_id(hass, gpslogger_client): return result["result"].data["webhook_id"] -async def test_missing_data(hass: HomeAssistant, gpslogger_client, webhook_id) -> None: +async def test_missing_data( + hass: HomeAssistant, gpslogger_client: TestClient, webhook_id: str +) -> None: """Test missing data.""" url = f"/api/webhook/{webhook_id}" @@ -111,8 +113,8 @@ async def test_enter_and_exit( hass: HomeAssistant, entity_registry: er.EntityRegistry, device_registry: dr.DeviceRegistry, - gpslogger_client, - webhook_id, + gpslogger_client: TestClient, + webhook_id: str, ) -> None: """Test when there is a known zone.""" url = f"/api/webhook/{webhook_id}" @@ -148,7 +150,7 @@ async def test_enter_and_exit( async def test_enter_with_attrs( - hass: HomeAssistant, gpslogger_client, webhook_id + hass: HomeAssistant, gpslogger_client: TestClient, webhook_id: str ) -> None: """Test when additional attributes are present.""" url = f"/api/webhook/{webhook_id}" @@ -210,7 +212,7 @@ async def test_enter_with_attrs( reason="The device_tracker component does not support unloading yet." ) async def test_load_unload_entry( - hass: HomeAssistant, gpslogger_client, webhook_id + hass: HomeAssistant, gpslogger_client: TestClient, webhook_id: str ) -> None: """Test that the appropriate dispatch signals are added and removed.""" url = f"/api/webhook/{webhook_id}"