Add type hints for MqttMockHAClient in test fixtures (#118683)

This commit is contained in:
epenet 2024-06-03 09:29:15 +02:00 committed by GitHub
parent 9a5706fa30
commit 1db7c7946e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,6 +10,7 @@ from homeassistant.core import HassJobType, HomeAssistant, ServiceCall
from homeassistant.setup import async_setup_component from homeassistant.setup import async_setup_component
from tests.common import async_fire_mqtt_message, async_mock_service, mock_component from tests.common import async_fire_mqtt_message, async_mock_service, mock_component
from tests.typing import MqttMockHAClient, MqttMockHAClientGenerator
@pytest.fixture(autouse=True, name="stub_blueprint_populate") @pytest.fixture(autouse=True, name="stub_blueprint_populate")
@ -24,7 +25,9 @@ def calls(hass: HomeAssistant) -> list[ServiceCall]:
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
async def setup_comp(hass: HomeAssistant, mqtt_mock_entry): async def setup_comp(
hass: HomeAssistant, mqtt_mock_entry: MqttMockHAClientGenerator
) -> MqttMockHAClient:
"""Initialize components.""" """Initialize components."""
mock_component(hass, "group") mock_component(hass, "group")
return await mqtt_mock_entry() return await mqtt_mock_entry()