diff --git a/tests/auth/providers/test_legacy_api_password.py b/tests/auth/providers/test_legacy_api_password.py index c8d32fbc59a..a9ef03fd27b 100644 --- a/tests/auth/providers/test_legacy_api_password.py +++ b/tests/auth/providers/test_legacy_api_password.py @@ -79,7 +79,7 @@ async def test_login_flow_works(hass: HomeAssistant, manager) -> None: async def test_create_repair_issue( hass: HomeAssistant, issue_registry: ir.IssueRegistry -): +) -> None: """Test legacy api password auth provider creates a reapir issue.""" hass.auth = await auth.auth_manager_from_config(hass, [CONFIG], []) ensure_auth_manager_loaded(hass.auth) diff --git a/tests/common.py b/tests/common.py index 24fb6cf458f..114e683fbfa 100644 --- a/tests/common.py +++ b/tests/common.py @@ -901,7 +901,7 @@ class MockEntityPlatform(entity_platform.EntityPlatform): platform=None, scan_interval=timedelta(seconds=15), entity_namespace=None, - ): + ) -> None: """Initialize a mock entity platform.""" if logger is None: logger = logging.getLogger("homeassistant.helpers.entity_platform") diff --git a/tests/components/bluetooth/test_wrappers.py b/tests/components/bluetooth/test_wrappers.py index 9c537079db7..0c5645b3f71 100644 --- a/tests/components/bluetooth/test_wrappers.py +++ b/tests/components/bluetooth/test_wrappers.py @@ -72,7 +72,7 @@ class FakeScanner(BaseHaRemoteScanner): class BaseFakeBleakClient: """Base class for fake bleak clients.""" - def __init__(self, address_or_ble_device: BLEDevice | str, **kwargs): + def __init__(self, address_or_ble_device: BLEDevice | str, **kwargs) -> None: """Initialize the fake bleak client.""" self._device_path = "/dev/test" self._device = address_or_ble_device diff --git a/tests/components/enigma2/test_config_flow.py b/tests/components/enigma2/test_config_flow.py index a1074ed9e34..74721ce0993 100644 --- a/tests/components/enigma2/test_config_flow.py +++ b/tests/components/enigma2/test_config_flow.py @@ -168,7 +168,7 @@ async def test_form_import_errors( assert result["reason"] == error_type -async def test_options_flow(hass: HomeAssistant, user_flow: str): +async def test_options_flow(hass: HomeAssistant, user_flow: str) -> None: """Test the form options.""" with patch( diff --git a/tests/components/homematicip_cloud/helper.py b/tests/components/homematicip_cloud/helper.py index f82880d3fa8..e7d7350f98e 100644 --- a/tests/components/homematicip_cloud/helper.py +++ b/tests/components/homematicip_cloud/helper.py @@ -77,7 +77,7 @@ class HomeFactory: hass: HomeAssistant, mock_connection, hmip_config_entry: config_entries.ConfigEntry, - ): + ) -> None: """Initialize the Factory.""" self.hass = hass self.mock_connection = mock_connection diff --git a/tests/components/knx/conftest.py b/tests/components/knx/conftest.py index 5cdeb0d8adb..cd7146b565b 100644 --- a/tests/components/knx/conftest.py +++ b/tests/components/knx/conftest.py @@ -44,7 +44,7 @@ class KNXTestKit: INDIVIDUAL_ADDRESS = "1.2.3" - def __init__(self, hass: HomeAssistant, mock_config_entry: MockConfigEntry): + def __init__(self, hass: HomeAssistant, mock_config_entry: MockConfigEntry) -> None: """Init KNX test helper class.""" self.hass: HomeAssistant = hass self.mock_config_entry: MockConfigEntry = mock_config_entry diff --git a/tests/components/light/common.py b/tests/components/light/common.py index fd9557b05b2..7c33c40ab63 100644 --- a/tests/components/light/common.py +++ b/tests/components/light/common.py @@ -254,7 +254,7 @@ class MockLight(MockToggleEntity, LightEntity): state, unique_id=None, supported_color_modes: set[ColorMode] | None = None, - ): + ) -> None: """Initialize the mock light.""" super().__init__(name, state, unique_id) if supported_color_modes is None: diff --git a/tests/components/logbook/common.py b/tests/components/logbook/common.py index 67b83a19768..67f12955581 100644 --- a/tests/components/logbook/common.py +++ b/tests/components/logbook/common.py @@ -27,7 +27,7 @@ class MockRow: event_type: str, data: dict[str, Any] | None = None, context: Context | None = None, - ): + ) -> None: """Init the fake row.""" self.event_type = event_type self.event_data = json.dumps(data, cls=JSONEncoder) diff --git a/tests/components/reddit/test_sensor.py b/tests/components/reddit/test_sensor.py index 92ee282e9c8..52dac07d621 100644 --- a/tests/components/reddit/test_sensor.py +++ b/tests/components/reddit/test_sensor.py @@ -111,7 +111,7 @@ class MockPraw: username: str, password: str, user_agent: str, - ): + ) -> None: """Add mock data for API return.""" self._data = MOCK_RESULTS @@ -123,7 +123,7 @@ class MockPraw: class MockSubreddit: """Mock class for a subreddit instance.""" - def __init__(self, subreddit: str, data): + def __init__(self, subreddit: str, data) -> None: """Add mock data for API return.""" self._subreddit = subreddit self._data = data diff --git a/tests/components/sonos/conftest.py b/tests/components/sonos/conftest.py index 478443fff76..c7f5cfb7223 100644 --- a/tests/components/sonos/conftest.py +++ b/tests/components/sonos/conftest.py @@ -323,7 +323,7 @@ class MockMusicServiceItem: parent_id: str, item_class: str, album_art_uri: None | str = None, - ): + ) -> None: """Initialize the mock item.""" self.title = title self.item_id = item_id diff --git a/tests/components/youtube/__init__.py b/tests/components/youtube/__init__.py index 8f6da97481a..1b559f0f1c4 100644 --- a/tests/components/youtube/__init__.py +++ b/tests/components/youtube/__init__.py @@ -19,7 +19,7 @@ class MockYouTube: channel_fixture: str = "youtube/get_channel.json", playlist_items_fixture: str = "youtube/get_playlist_items.json", subscriptions_fixture: str = "youtube/get_subscriptions.json", - ): + ) -> None: """Initialize mock service.""" self._channel_fixture = channel_fixture self._playlist_items_fixture = playlist_items_fixture diff --git a/tests/helpers/test_entity.py b/tests/helpers/test_entity.py index a8524d73a5d..cc53bca8e4d 100644 --- a/tests/helpers/test_entity.py +++ b/tests/helpers/test_entity.py @@ -1873,7 +1873,7 @@ async def test_change_entity_id( assert len(ent.remove_calls) == 2 -def test_entity_description_as_dataclass(snapshot: SnapshotAssertion): +def test_entity_description_as_dataclass(snapshot: SnapshotAssertion) -> None: """Test EntityDescription behaves like a dataclass.""" obj = entity.EntityDescription("blah", device_class="test") @@ -1888,7 +1888,7 @@ def test_entity_description_as_dataclass(snapshot: SnapshotAssertion): assert repr(obj) == snapshot -def test_extending_entity_description(snapshot: SnapshotAssertion): +def test_extending_entity_description(snapshot: SnapshotAssertion) -> None: """Test extending entity descriptions.""" @dataclasses.dataclass(frozen=True) diff --git a/tests/helpers/test_template.py b/tests/helpers/test_template.py index 6b75ff384b6..0547ddf8823 100644 --- a/tests/helpers/test_template.py +++ b/tests/helpers/test_template.py @@ -2067,7 +2067,7 @@ def test_states_function(hass: HomeAssistant) -> None: async def test_state_translated( hass: HomeAssistant, entity_registry: er.EntityRegistry -): +) -> None: """Test state_translated method.""" assert await async_setup_component( hass, diff --git a/tests/helpers/test_translation.py b/tests/helpers/test_translation.py index dfe96562a4a..da81016e153 100644 --- a/tests/helpers/test_translation.py +++ b/tests/helpers/test_translation.py @@ -549,7 +549,7 @@ async def test_get_cached_translations( } -async def test_setup(hass: HomeAssistant): +async def test_setup(hass: HomeAssistant) -> None: """Test the setup load listeners helper.""" translation.async_setup(hass) @@ -577,7 +577,7 @@ async def test_setup(hass: HomeAssistant): mock.assert_not_called() -async def test_translate_state(hass: HomeAssistant): +async def test_translate_state(hass: HomeAssistant) -> None: """Test the state translation helper.""" result = translation.async_translate_state( hass, "unavailable", "binary_sensor", "platform", "translation_key", None diff --git a/tests/helpers/test_trigger.py b/tests/helpers/test_trigger.py index e8322c7e660..0bd5da0707c 100644 --- a/tests/helpers/test_trigger.py +++ b/tests/helpers/test_trigger.py @@ -287,7 +287,9 @@ async def test_async_initialize_triggers( unsub() -async def test_pluggable_action(hass: HomeAssistant, service_calls: list[ServiceCall]): +async def test_pluggable_action( + hass: HomeAssistant, service_calls: list[ServiceCall] +) -> None: """Test normal behavior of pluggable actions.""" update_1 = MagicMock() update_2 = MagicMock()