Improve type hints in ssdp tests (#123892)

This commit is contained in:
epenet 2024-08-14 12:48:10 +02:00 committed by GitHub
parent a712eca70a
commit 165ec62405
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,11 +1,14 @@
"""Configuration for SSDP tests.""" """Configuration for SSDP tests."""
from collections.abc import Generator
from unittest.mock import AsyncMock, patch from unittest.mock import AsyncMock, patch
from async_upnp_client.server import UpnpServer from async_upnp_client.server import UpnpServer
from async_upnp_client.ssdp_listener import SsdpListener from async_upnp_client.ssdp_listener import SsdpListener
import pytest import pytest
from homeassistant.core import HomeAssistant
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
async def silent_ssdp_listener(): async def silent_ssdp_listener():
@ -32,7 +35,7 @@ async def disabled_upnp_server():
@pytest.fixture @pytest.fixture
def mock_flow_init(hass): def mock_flow_init(hass: HomeAssistant) -> Generator[AsyncMock]:
"""Mock hass.config_entries.flow.async_init.""" """Mock hass.config_entries.flow.async_init."""
with patch.object( with patch.object(
hass.config_entries.flow, "async_init", return_value=AsyncMock() hass.config_entries.flow, "async_init", return_value=AsyncMock()