diff --git a/homeassistant/components/conversation/trace.py b/homeassistant/components/conversation/trace.py index 0bd2fe8ed5b..08b271d9058 100644 --- a/homeassistant/components/conversation/trace.py +++ b/homeassistant/components/conversation/trace.py @@ -94,7 +94,7 @@ def async_conversation_trace_append( @contextmanager -def async_conversation_trace() -> Generator[ConversationTrace, None]: +def async_conversation_trace() -> Generator[ConversationTrace]: """Create a new active ConversationTrace.""" trace = ConversationTrace() token = _current_trace.set(trace) diff --git a/homeassistant/components/litterrobot/hub.py b/homeassistant/components/litterrobot/hub.py index 2e31bcf9906..77050855c70 100644 --- a/homeassistant/components/litterrobot/hub.py +++ b/homeassistant/components/litterrobot/hub.py @@ -60,13 +60,13 @@ class LitterRobotHub: except LitterRobotException as ex: raise ConfigEntryNotReady("Unable to connect to Litter-Robot API") from ex - def litter_robots(self) -> Generator[LitterRobot, Any, Any]: + def litter_robots(self) -> Generator[LitterRobot]: """Get Litter-Robots from the account.""" return ( robot for robot in self.account.robots if isinstance(robot, LitterRobot) ) - def feeder_robots(self) -> Generator[FeederRobot, Any, Any]: + def feeder_robots(self) -> Generator[FeederRobot]: """Get Feeder-Robots from the account.""" return ( robot for robot in self.account.robots if isinstance(robot, FeederRobot) diff --git a/tests/components/chacon_dio/conftest.py b/tests/components/chacon_dio/conftest.py index f837403f14e..3c3b970cec0 100644 --- a/tests/components/chacon_dio/conftest.py +++ b/tests/components/chacon_dio/conftest.py @@ -24,7 +24,7 @@ MOCK_COVER_DEVICE = { @pytest.fixture -def mock_setup_entry() -> Generator[AsyncMock, None, None]: +def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( "homeassistant.components.chacon_dio.async_setup_entry", return_value=True diff --git a/tests/components/doorbird/conftest.py b/tests/components/doorbird/conftest.py index bb623e69485..dbd72a0bac9 100644 --- a/tests/components/doorbird/conftest.py +++ b/tests/components/doorbird/conftest.py @@ -42,7 +42,7 @@ def doorbird_schedule() -> list[DoorBirdScheduleEntry]: @pytest.fixture def doorbird_api( doorbird_info: dict[str, Any], doorbird_schedule: dict[str, Any] -) -> Generator[Any, Any, DoorBird]: +) -> Generator[DoorBird]: """Mock the DoorBirdAPI.""" api = get_mock_doorbird_api(info=doorbird_info, schedule=doorbird_schedule) with patch_doorbird_api_entry_points(api): @@ -50,7 +50,7 @@ def doorbird_api( @contextmanager -def patch_doorbird_api_entry_points(api: MagicMock) -> Generator[Any, Any, DoorBird]: +def patch_doorbird_api_entry_points(api: MagicMock) -> Generator[DoorBird]: """Mock the DoorBirdAPI.""" with ( patch( diff --git a/tests/components/enphase_envoy/conftest.py b/tests/components/enphase_envoy/conftest.py index b1facd218dc..ab6e0e4f097 100644 --- a/tests/components/enphase_envoy/conftest.py +++ b/tests/components/enphase_envoy/conftest.py @@ -67,7 +67,7 @@ def config_fixture() -> dict[str, str]: @pytest.fixture async def mock_envoy( request: pytest.FixtureRequest, -) -> AsyncGenerator[AsyncMock, None]: +) -> AsyncGenerator[AsyncMock]: """Define a mocked Envoy fixture.""" with ( patch( diff --git a/tests/components/home_connect/test_light.py b/tests/components/home_connect/test_light.py index a90eeee74da..8d918dc5815 100644 --- a/tests/components/home_connect/test_light.py +++ b/tests/components/home_connect/test_light.py @@ -1,7 +1,6 @@ """Tests for home_connect light entities.""" from collections.abc import Awaitable, Callable, Generator -from typing import Any from unittest.mock import MagicMock, Mock from homeconnect.api import HomeConnectError @@ -48,7 +47,7 @@ def platforms() -> list[str]: async def test_light( - bypass_throttle: Generator[None, Any, None], + bypass_throttle: Generator[None], hass: HomeAssistant, config_entry: MockConfigEntry, integration_setup: Callable[[], Awaitable[bool]], @@ -159,7 +158,7 @@ async def test_light_functionality( service_data: dict, state: str, appliance: Mock, - bypass_throttle: Generator[None, Any, None], + bypass_throttle: Generator[None], hass: HomeAssistant, config_entry: MockConfigEntry, integration_setup: Callable[[], Awaitable[bool]], @@ -273,7 +272,7 @@ async def test_switch_exception_handling( mock_attr: str, attr_side_effect: list, problematic_appliance: Mock, - bypass_throttle: Generator[None, Any, None], + bypass_throttle: Generator[None], hass: HomeAssistant, integration_setup: Callable[[], Awaitable[bool]], config_entry: MockConfigEntry, diff --git a/tests/components/home_connect/test_switch.py b/tests/components/home_connect/test_switch.py index b23fbc13c21..c6a7b384036 100644 --- a/tests/components/home_connect/test_switch.py +++ b/tests/components/home_connect/test_switch.py @@ -1,7 +1,6 @@ """Tests for home_connect sensor entities.""" from collections.abc import Awaitable, Callable, Generator -from typing import Any from unittest.mock import MagicMock, Mock from homeconnect.api import HomeConnectError @@ -48,7 +47,7 @@ def platforms() -> list[str]: async def test_switches( - bypass_throttle: Generator[None, Any, None], + bypass_throttle: Generator[None], hass: HomeAssistant, config_entry: MockConfigEntry, integration_setup: Callable[[], Awaitable[bool]], @@ -119,7 +118,7 @@ async def test_switch_functionality( status: dict, service: str, state: str, - bypass_throttle: Generator[None, Any, None], + bypass_throttle: Generator[None], hass: HomeAssistant, config_entry: MockConfigEntry, integration_setup: Callable[[], Awaitable[bool]], @@ -189,7 +188,7 @@ async def test_switch_exception_handling( status: dict, service: str, mock_attr: str, - bypass_throttle: Generator[None, Any, None], + bypass_throttle: Generator[None], hass: HomeAssistant, integration_setup: Callable[[], Awaitable[bool]], config_entry: MockConfigEntry, diff --git a/tests/components/madvr/conftest.py b/tests/components/madvr/conftest.py index 1fdf3302eb6..187786c6964 100644 --- a/tests/components/madvr/conftest.py +++ b/tests/components/madvr/conftest.py @@ -14,7 +14,7 @@ from tests.common import MockConfigEntry @pytest.fixture -def mock_setup_entry() -> Generator[AsyncMock, None, None]: +def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( "homeassistant.components.madvr.async_setup_entry", @@ -24,7 +24,7 @@ def mock_setup_entry() -> Generator[AsyncMock, None, None]: @pytest.fixture -def mock_madvr_client() -> Generator[AsyncMock, None, None]: +def mock_madvr_client() -> Generator[AsyncMock]: """Mock a MadVR client.""" with ( patch( diff --git a/tests/components/madvr/test_config_flow.py b/tests/components/madvr/test_config_flow.py index b3edbf25fb1..6dc84fd6b00 100644 --- a/tests/components/madvr/test_config_flow.py +++ b/tests/components/madvr/test_config_flow.py @@ -17,7 +17,7 @@ from tests.common import MockConfigEntry @pytest.fixture(autouse=True) -async def avoid_wait() -> AsyncGenerator[None, None]: +async def avoid_wait() -> AsyncGenerator[None]: """Mock sleep.""" with patch("homeassistant.components.madvr.config_flow.RETRY_INTERVAL", 0): yield diff --git a/tests/components/mqtt/test_select.py b/tests/components/mqtt/test_select.py index b2a4a1f2b49..60eb4893760 100644 --- a/tests/components/mqtt/test_select.py +++ b/tests/components/mqtt/test_select.py @@ -67,9 +67,7 @@ DEFAULT_CONFIG = { } -def _test_run_select_setup_params( - topic: str, -) -> Generator[tuple[ConfigType, str], None]: +def _test_run_select_setup_params(topic: str) -> Generator[tuple[ConfigType, str]]: yield ( { mqtt.DOMAIN: { @@ -593,7 +591,7 @@ async def test_entity_debug_info_message( def _test_options_attributes_options_config( request: tuple[list[str]], -) -> Generator[tuple[ConfigType, list[str]], None]: +) -> Generator[tuple[ConfigType, list[str]]]: for option in request: yield ( { diff --git a/tests/components/simplefin/conftest.py b/tests/components/simplefin/conftest.py index b4bef07d4e1..328e16ccbd0 100644 --- a/tests/components/simplefin/conftest.py +++ b/tests/components/simplefin/conftest.py @@ -16,7 +16,7 @@ MOCK_ACCESS_URL = "https://i:am@yomama.house.com" @pytest.fixture -def mock_setup_entry() -> Generator[AsyncMock, None, None]: +def mock_setup_entry() -> Generator[AsyncMock]: """Mock setting up a config entry.""" with patch( "homeassistant.components.simplefin.async_setup_entry", return_value=True diff --git a/tests/components/system_bridge/conftest.py b/tests/components/system_bridge/conftest.py index 85e99ab533d..2f1f87485e7 100644 --- a/tests/components/system_bridge/conftest.py +++ b/tests/components/system_bridge/conftest.py @@ -64,7 +64,7 @@ def mock_config_entry() -> MockConfigEntry: @pytest.fixture(autouse=True) -def mock_setup_notify_platform() -> Generator[AsyncMock, None, None]: +def mock_setup_notify_platform() -> Generator[AsyncMock]: """Mock notify platform setup.""" with patch( "homeassistant.helpers.discovery.async_load_platform", @@ -73,7 +73,7 @@ def mock_setup_notify_platform() -> Generator[AsyncMock, None, None]: @pytest.fixture -def mock_version() -> Generator[AsyncMock, None, None]: +def mock_version() -> Generator[AsyncMock]: """Return a mocked Version class.""" with patch( "homeassistant.components.system_bridge.Version", @@ -90,7 +90,7 @@ def mock_websocket_client( register_data_listener_model: RegisterDataListener = RegisterDataListener( modules=REGISTER_MODULES, ), -) -> Generator[MagicMock, None, None]: +) -> Generator[MagicMock]: """Return a mocked WebSocketClient client.""" with (