diff --git a/tests/components/blebox/test_cover.py b/tests/components/blebox/test_cover.py index d0a10cb5bde..cbf8f5e589b 100644 --- a/tests/components/blebox/test_cover.py +++ b/tests/components/blebox/test_cover.py @@ -427,7 +427,7 @@ async def test_closed_state(feature, hass: HomeAssistant) -> None: assert hass.states.get(entity_id).state == STATE_CLOSED -async def test_tilt_position(shutterbox, hass): +async def test_tilt_position(shutterbox, hass: HomeAssistant) -> None: """Test tilt capability is available.""" feature_mock, entity_id = shutterbox @@ -443,7 +443,7 @@ async def test_tilt_position(shutterbox, hass): assert state.attributes[ATTR_CURRENT_TILT_POSITION] == 10 -async def test_set_tilt_position(shutterbox, hass): +async def test_set_tilt_position(shutterbox, hass: HomeAssistant) -> None: """Test tilt position setting.""" feature_mock, entity_id = shutterbox diff --git a/tests/components/devolo_home_control/test_switch.py b/tests/components/devolo_home_control/test_switch.py index 62de9038483..8f160702408 100644 --- a/tests/components/devolo_home_control/test_switch.py +++ b/tests/components/devolo_home_control/test_switch.py @@ -16,7 +16,7 @@ from . import configure_integration from .mocks import HomeControlMock, HomeControlMockSwitch -async def test_switch(hass: HomeAssistant): +async def test_switch(hass: HomeAssistant) -> None: """Test setup and state change of a switch device.""" entry = configure_integration(hass) test_gateway = HomeControlMockSwitch() @@ -66,7 +66,7 @@ async def test_switch(hass: HomeAssistant): assert hass.states.get(f"{DOMAIN}.test").state == STATE_UNAVAILABLE -async def test_remove_from_hass(hass: HomeAssistant): +async def test_remove_from_hass(hass: HomeAssistant) -> None: """Test removing entity.""" entry = configure_integration(hass) test_gateway = HomeControlMockSwitch() diff --git a/tests/components/ezviz/test_config_flow.py b/tests/components/ezviz/test_config_flow.py index 939bb92bcc0..d3bd2a1bed6 100644 --- a/tests/components/ezviz/test_config_flow.py +++ b/tests/components/ezviz/test_config_flow.py @@ -106,7 +106,7 @@ async def test_user_custom_url(hass: HomeAssistant, ezviz_config_flow) -> None: assert len(mock_setup_entry.mock_calls) == 1 -async def test_async_step_reauth(hass, ezviz_config_flow): +async def test_async_step_reauth(hass: HomeAssistant, ezviz_config_flow) -> None: """Test the reauth step.""" result = await hass.config_entries.flow.async_init( @@ -149,7 +149,9 @@ async def test_async_step_reauth(hass, ezviz_config_flow): assert result["reason"] == "reauth_successful" -async def test_step_discovery_abort_if_cloud_account_missing(hass): +async def test_step_discovery_abort_if_cloud_account_missing( + hass: HomeAssistant, +) -> None: """Test discovery and confirm step, abort if cloud account was removed.""" result = await hass.config_entries.flow.async_init( @@ -172,7 +174,7 @@ async def test_step_discovery_abort_if_cloud_account_missing(hass): assert result["reason"] == "ezviz_cloud_account_missing" -async def test_step_reauth_abort_if_cloud_account_missing(hass): +async def test_step_reauth_abort_if_cloud_account_missing(hass: HomeAssistant) -> None: """Test reauth and confirm step, abort if cloud account was removed.""" result = await hass.config_entries.flow.async_init( @@ -183,8 +185,8 @@ async def test_step_reauth_abort_if_cloud_account_missing(hass): async def test_async_step_integration_discovery( - hass, ezviz_config_flow, ezviz_test_rtsp_config_flow -): + hass: HomeAssistant, ezviz_config_flow, ezviz_test_rtsp_config_flow +) -> None: """Test discovery and confirm step.""" with patch("homeassistant.components.ezviz.PLATFORMS_BY_TYPE", []): await init_integration(hass) @@ -530,7 +532,9 @@ async def test_user_custom_url_exception( assert result["reason"] == "unknown" -async def test_async_step_reauth_exception(hass, ezviz_config_flow): +async def test_async_step_reauth_exception( + hass: HomeAssistant, ezviz_config_flow +) -> None: """Test the reauth step exceptions.""" result = await hass.config_entries.flow.async_init( diff --git a/tests/components/glances/test_sensor.py b/tests/components/glances/test_sensor.py index e5aadc92156..9164dbadb14 100644 --- a/tests/components/glances/test_sensor.py +++ b/tests/components/glances/test_sensor.py @@ -43,7 +43,7 @@ async def test_sensor_states(hass: HomeAssistant) -> None: ) async def test_migrate_unique_id( hass: HomeAssistant, object_id: str, old_unique_id: str, new_unique_id: str -): +) -> None: """Test unique id migration.""" old_config_data = {**MOCK_USER_INPUT, "name": "Glances"} entry = MockConfigEntry(domain=DOMAIN, data=old_config_data) diff --git a/tests/components/lidarr/test_sensor.py b/tests/components/lidarr/test_sensor.py index 7fe347f4619..7dec62f1c47 100644 --- a/tests/components/lidarr/test_sensor.py +++ b/tests/components/lidarr/test_sensor.py @@ -1,6 +1,4 @@ """The tests for Lidarr sensor platform.""" -from unittest.mock import AsyncMock - from homeassistant.components.sensor import CONF_STATE_CLASS, SensorStateClass from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT from homeassistant.core import HomeAssistant @@ -11,9 +9,9 @@ from .conftest import ComponentSetup async def test_sensors( hass: HomeAssistant, setup_integration: ComponentSetup, - entity_registry_enabled_by_default: AsyncMock, + entity_registry_enabled_by_default: None, connection, -): +) -> None: """Test for successfully setting up the Lidarr platform.""" await setup_integration() diff --git a/tests/components/rapt_ble/test_sensor.py b/tests/components/rapt_ble/test_sensor.py index c610cc526b8..8aad759eb76 100644 --- a/tests/components/rapt_ble/test_sensor.py +++ b/tests/components/rapt_ble/test_sensor.py @@ -18,7 +18,7 @@ from tests.common import MockConfigEntry from tests.components.bluetooth import inject_bluetooth_service_info -async def test_sensors(hass: HomeAssistant): +async def test_sensors(hass: HomeAssistant) -> None: """Test setting up creates the sensors.""" entry = MockConfigEntry( domain=DOMAIN, diff --git a/tests/components/rituals_perfume_genie/test_init.py b/tests/components/rituals_perfume_genie/test_init.py index 8766e99f542..7f2f06b707c 100644 --- a/tests/components/rituals_perfume_genie/test_init.py +++ b/tests/components/rituals_perfume_genie/test_init.py @@ -40,7 +40,7 @@ async def test_config_entry_unload(hass: HomeAssistant) -> None: async def test_entity_id_migration( - hass: HomeAssistant, entity_registry: er.RegistryEntry + hass: HomeAssistant, entity_registry: er.EntityRegistry ) -> None: """Test the migration of unique IDs on config entry setup.""" config_entry = mock_config_entry(unique_id="binary_sensor_test_diffuser_v1") diff --git a/tests/components/sonos/test_repairs.py b/tests/components/sonos/test_repairs.py index b99704559ec..b86c6bd5f66 100644 --- a/tests/components/sonos/test_repairs.py +++ b/tests/components/sonos/test_repairs.py @@ -17,7 +17,7 @@ from tests.common import MockConfigEntry, async_fire_time_changed async def test_subscription_repair_issues( hass: HomeAssistant, config_entry: MockConfigEntry, soco, zgs_discovery -): +) -> None: """Test repair issues handling for failed subscriptions.""" issue_registry = async_get_issue_registry(hass) diff --git a/tests/components/voip/test_devices.py b/tests/components/voip/test_devices.py index af5b176281e..c421a08ccf8 100644 --- a/tests/components/voip/test_devices.py +++ b/tests/components/voip/test_devices.py @@ -1,5 +1,4 @@ """Test VoIP devices.""" - from __future__ import annotations from voip_utils import CallInfo @@ -7,14 +6,14 @@ from voip_utils import CallInfo from homeassistant.components.voip import DOMAIN from homeassistant.components.voip.devices import VoIPDevice, VoIPDevices from homeassistant.core import HomeAssistant -from homeassistant.helpers.device_registry import DeviceRegistry +from homeassistant.helpers import device_registry as dr async def test_device_registry_info( hass: HomeAssistant, voip_devices: VoIPDevices, call_info: CallInfo, - device_registry: DeviceRegistry, + device_registry: dr.DeviceRegistry, ) -> None: """Test info in device registry.""" voip_device = voip_devices.async_get_or_create(call_info) @@ -41,7 +40,7 @@ async def test_device_registry_info_from_unknown_phone( hass: HomeAssistant, voip_devices: VoIPDevices, call_info: CallInfo, - device_registry: DeviceRegistry, + device_registry: dr.DeviceRegistry, ) -> None: """Test info in device registry from unknown phone.""" call_info.headers["user-agent"] = "Unknown" @@ -58,7 +57,7 @@ async def test_remove_device_registry_entry( hass: HomeAssistant, voip_device: VoIPDevice, voip_devices: VoIPDevices, - device_registry: DeviceRegistry, + device_registry: dr.DeviceRegistry, ) -> None: """Test removing a device registry entry.""" assert voip_device.voip_id in voip_devices.devices diff --git a/tests/components/webhook/test_init.py b/tests/components/webhook/test_init.py index c0853aa49d9..ff0346a3d8b 100644 --- a/tests/components/webhook/test_init.py +++ b/tests/components/webhook/test_init.py @@ -161,7 +161,7 @@ async def test_webhook_head(hass: HomeAssistant, mock_client) -> None: assert len(hooks) == 1 # Should not have been called -async def test_webhook_get(hass, mock_client): +async def test_webhook_get(hass: HomeAssistant, mock_client) -> None: """Test sending a get request to a webhook.""" hooks = [] webhook_id = webhook.async_generate_id() @@ -191,7 +191,7 @@ async def test_webhook_get(hass, mock_client): assert len(hooks) == 1 # Should not have been called -async def test_webhook_not_allowed_method(hass): +async def test_webhook_not_allowed_method(hass: HomeAssistant) -> None: """Test that an exception is raised if an unsupported method is used.""" webhook_id = webhook.async_generate_id() diff --git a/tests/components/webhook/test_trigger.py b/tests/components/webhook/test_trigger.py index c2788deca30..a10b77eb105 100644 --- a/tests/components/webhook/test_trigger.py +++ b/tests/components/webhook/test_trigger.py @@ -111,7 +111,9 @@ async def test_webhook_post( assert len(events) == 1 -async def test_webhook_allowed_methods_internet(hass, hass_client_no_auth): +async def test_webhook_allowed_methods_internet( + hass: HomeAssistant, hass_client_no_auth: ClientSessionGenerator +) -> None: """Test the webhook obeys allowed_methods and local_only options.""" events = [] diff --git a/tests/helpers/test_template.py b/tests/helpers/test_template.py index e18758658d6..73854147372 100644 --- a/tests/helpers/test_template.py +++ b/tests/helpers/test_template.py @@ -1641,7 +1641,7 @@ def test_states_function(hass: HomeAssistant) -> None: assert tpl.async_render() == "available" -def test_has_value(hass): +def test_has_value(hass: HomeAssistant) -> None: """Test has_value method.""" hass.states.async_set("test.value1", 1) hass.states.async_set("test.unavailable", STATE_UNAVAILABLE)