diff --git a/tests/components/drop_connect/test_sensor.py b/tests/components/drop_connect/test_sensor.py index 4873d1edbd1..cb56522a09d 100644 --- a/tests/components/drop_connect/test_sensor.py +++ b/tests/components/drop_connect/test_sensor.py @@ -47,7 +47,7 @@ from tests.typing import MqttMockHAClient @pytest.fixture(autouse=True) -def only_sensor_platform() -> Generator[[], None]: +def only_sensor_platform() -> Generator[None]: """Only setup the DROP sensor platform.""" with patch("homeassistant.components.drop_connect.PLATFORMS", [Platform.SENSOR]): yield diff --git a/tests/components/flume/conftest.py b/tests/components/flume/conftest.py index 999bbd70ce8..fb0d0157bbc 100644 --- a/tests/components/flume/conftest.py +++ b/tests/components/flume/conftest.py @@ -104,7 +104,7 @@ def encode_access_token() -> str: @pytest.fixture(name="access_token") -def access_token_fixture(requests_mock: Mocker) -> Generator[None, None, None]: +def access_token_fixture(requests_mock: Mocker) -> Generator[None]: """Fixture to setup the access token.""" token_response = { "refresh_token": REFRESH_TOKEN, diff --git a/tests/components/homekit/conftest.py b/tests/components/homekit/conftest.py index 26333b0b807..7acb11e10ab 100644 --- a/tests/components/homekit/conftest.py +++ b/tests/components/homekit/conftest.py @@ -4,7 +4,6 @@ from asyncio import AbstractEventLoop from collections.abc import Generator from contextlib import suppress import os -from typing import Any from unittest.mock import MagicMock, patch import pytest @@ -19,7 +18,7 @@ from tests.common import async_capture_events @pytest.fixture -def iid_storage(hass): +def iid_storage(hass: HomeAssistant) -> Generator[AccessoryIIDStorage]: """Mock the iid storage.""" with patch.object(AccessoryIIDStorage, "_async_schedule_save"): yield AccessoryIIDStorage(hass, "") @@ -28,7 +27,7 @@ def iid_storage(hass): @pytest.fixture def run_driver( hass: HomeAssistant, event_loop: AbstractEventLoop, iid_storage: AccessoryIIDStorage -) -> Generator[HomeDriver, Any, None]: +) -> Generator[HomeDriver]: """Return a custom AccessoryDriver instance for HomeKit accessory init. This mock does not mock async_stop, so the driver will not be stopped @@ -57,7 +56,7 @@ def run_driver( @pytest.fixture def hk_driver( hass: HomeAssistant, event_loop: AbstractEventLoop, iid_storage: AccessoryIIDStorage -) -> Generator[HomeDriver, Any, None]: +) -> Generator[HomeDriver]: """Return a custom AccessoryDriver instance for HomeKit accessory init.""" with ( patch("pyhap.accessory_driver.AsyncZeroconf"), @@ -89,7 +88,7 @@ def mock_hap( event_loop: AbstractEventLoop, iid_storage: AccessoryIIDStorage, mock_zeroconf: MagicMock, -) -> Generator[HomeDriver, Any, None]: +) -> Generator[HomeDriver]: """Return a custom AccessoryDriver instance for HomeKit accessory init.""" with ( patch("pyhap.accessory_driver.AsyncZeroconf"), @@ -128,7 +127,7 @@ def events(hass): @pytest.fixture -def demo_cleanup(hass): +def demo_cleanup(hass: HomeAssistant) -> Generator[None]: """Clean up device tracker demo file.""" yield with suppress(FileNotFoundError): diff --git a/tests/components/incomfort/conftest.py b/tests/components/incomfort/conftest.py index 122868605c8..f17547a1445 100644 --- a/tests/components/incomfort/conftest.py +++ b/tests/components/incomfort/conftest.py @@ -77,10 +77,9 @@ def mock_room_status() -> dict[str, Any]: @pytest.fixture def mock_incomfort( - hass: HomeAssistant, mock_heater_status: dict[str, Any], mock_room_status: dict[str, Any], -) -> Generator[MagicMock, None]: +) -> Generator[MagicMock]: """Mock the InComfort gateway client.""" class MockRoom: diff --git a/tests/components/tibber/conftest.py b/tests/components/tibber/conftest.py index fc6596444c5..0b48531bde1 100644 --- a/tests/components/tibber/conftest.py +++ b/tests/components/tibber/conftest.py @@ -27,7 +27,7 @@ def config_entry(hass: HomeAssistant) -> MockConfigEntry: @pytest.fixture async def mock_tibber_setup( config_entry: MockConfigEntry, hass: HomeAssistant -) -> AsyncGenerator[None, MagicMock]: +) -> AsyncGenerator[MagicMock]: """Mock tibber entry setup.""" unique_user_id = "unique_user_id" title = "title" diff --git a/tests/util/test_loop.py b/tests/util/test_loop.py index f4846d98898..3ff7128938f 100644 --- a/tests/util/test_loop.py +++ b/tests/util/test_loop.py @@ -18,7 +18,7 @@ def banned_function(): @contextlib.contextmanager -def patch_get_current_frame(stack: list[Mock]) -> Generator[None, None, None]: +def patch_get_current_frame(stack: list[Mock]) -> Generator[None]: """Patch get_current_frame.""" frames = extract_stack_to_frame(stack) with (