diff --git a/tests/components/androidtv/patchers.py b/tests/components/androidtv/patchers.py index 90a13523ebe..1c32e1770e0 100644 --- a/tests/components/androidtv/patchers.py +++ b/tests/components/androidtv/patchers.py @@ -37,7 +37,7 @@ class AdbDeviceTcpAsyncFake: """Try to connect to a device.""" raise NotImplementedError - async def shell(self, cmd, *args, **kwargs): + async def shell(self, cmd, *args, **kwargs) -> bytes | str | None: """Send an ADB shell command.""" return None diff --git a/tests/components/enigma2/conftest.py b/tests/components/enigma2/conftest.py index f879fb327d7..0e4b4c24e26 100644 --- a/tests/components/enigma2/conftest.py +++ b/tests/components/enigma2/conftest.py @@ -78,7 +78,7 @@ class MockDevice: } } - def get_version(self): + def get_version(self) -> str | None: """Return the version.""" return None diff --git a/tests/components/ipma/test_weather.py b/tests/components/ipma/test_weather.py index b7ef1347ca5..997eb582083 100644 --- a/tests/components/ipma/test_weather.py +++ b/tests/components/ipma/test_weather.py @@ -4,6 +4,7 @@ import datetime from unittest.mock import patch from freezegun.api import FrozenDateTimeFactory +from pyipma.observation import Observation import pytest from syrupy.assertion import SnapshotAssertion @@ -43,7 +44,7 @@ TEST_CONFIG_HOURLY = { class MockBadLocation(MockLocation): """Mock Location with unresponsive api.""" - async def observation(self, api): + async def observation(self, api) -> Observation | None: """Mock Observation.""" return None diff --git a/tests/components/modbus/conftest.py b/tests/components/modbus/conftest.py index 067fb2d123d..6741504585a 100644 --- a/tests/components/modbus/conftest.py +++ b/tests/components/modbus/conftest.py @@ -61,7 +61,7 @@ def register_words_fixture(): @pytest.fixture(name="config_addon") -def config_addon_fixture(): +def config_addon_fixture() -> dict[str, Any] | None: """Add extra configuration items.""" return None diff --git a/tests/components/nest/test_api.py b/tests/components/nest/test_api.py index fd07233fa8c..a13d4d3a337 100644 --- a/tests/components/nest/test_api.py +++ b/tests/components/nest/test_api.py @@ -18,7 +18,7 @@ from homeassistant.components.nest.const import API_URL, OAUTH2_TOKEN, SDM_SCOPE from homeassistant.core import HomeAssistant from homeassistant.util import dt as dt_util -from .common import CLIENT_ID, CLIENT_SECRET, PROJECT_ID, PlatformSetup +from .common import CLIENT_ID, CLIENT_SECRET, PROJECT_ID, FakeSubscriber, PlatformSetup from .conftest import FAKE_REFRESH_TOKEN, FAKE_TOKEN from tests.test_util.aiohttp import AiohttpClientMocker @@ -27,7 +27,7 @@ FAKE_UPDATED_TOKEN = "fake-updated-token" @pytest.fixture -def subscriber() -> None: +def subscriber() -> FakeSubscriber | None: """Disable default subscriber since tests use their own patch.""" return None diff --git a/tests/components/nest/test_init.py b/tests/components/nest/test_init.py index 2beed07a979..f3226c936fb 100644 --- a/tests/components/nest/test_init.py +++ b/tests/components/nest/test_init.py @@ -67,13 +67,15 @@ def warning_caplog( @pytest.fixture -def subscriber_side_effect() -> None: +def subscriber_side_effect() -> Any | None: """Fixture to inject failures into FakeSubscriber start.""" return None @pytest.fixture -def failing_subscriber(subscriber_side_effect: Any) -> YieldFixture[FakeSubscriber]: +def failing_subscriber( + subscriber_side_effect: Any | None, +) -> YieldFixture[FakeSubscriber]: """Fixture overriding default subscriber behavior to allow failure injection.""" subscriber = FakeSubscriber() with patch( diff --git a/tests/components/notify/test_legacy.py b/tests/components/notify/test_legacy.py index d6478c358bf..b499486b312 100644 --- a/tests/components/notify/test_legacy.py +++ b/tests/components/notify/test_legacy.py @@ -226,7 +226,11 @@ async def test_invalid_service( ) -> None: """Test service setup with an invalid service object or platform.""" - def get_service(hass, config, discovery_info=None): + def get_service( + hass: HomeAssistant, + config: ConfigType, + discovery_info: DiscoveryInfoType | None = None, + ) -> notify.BaseNotificationService | None: """Return None for an invalid notify service.""" return None diff --git a/tests/components/rainbird/test_config_flow.py b/tests/components/rainbird/test_config_flow.py index 174bbdb3d48..87506ad656c 100644 --- a/tests/components/rainbird/test_config_flow.py +++ b/tests/components/rainbird/test_config_flow.py @@ -40,7 +40,7 @@ def mock_responses() -> list[AiohttpClientMockResponse]: @pytest.fixture(autouse=True) -async def config_entry_data() -> None: +async def config_entry_data() -> dict[str, Any] | None: """Fixture to disable config entry setup for exercising config flow.""" return None