1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Fix incorrect zeroconf type hint in tests (#118465)

* Fix incorrect `mock_async_zeroconf` type hint

* Adjust thread

* One more

* Fix mock_zeroconf also

* Adjust

* Adjust
This commit is contained in:
epenet
2024-05-30 21:57:09 +02:00
committed by GitHub
parent 1352c4e427
commit a5dc4cb1c7
9 changed files with 40 additions and 32 deletions

View File

@@ -1190,7 +1190,7 @@ def disable_translations_once(translations_once):
@pytest.fixture
def mock_zeroconf() -> Generator[None, None, None]:
def mock_zeroconf() -> Generator[MagicMock, None, None]:
"""Mock zeroconf."""
from zeroconf import DNSCache # pylint: disable=import-outside-toplevel
@@ -1206,7 +1206,7 @@ def mock_zeroconf() -> Generator[None, None, None]:
@pytest.fixture
def mock_async_zeroconf(mock_zeroconf: None) -> Generator[None, None, None]:
def mock_async_zeroconf(mock_zeroconf: MagicMock) -> Generator[MagicMock, None, None]:
"""Mock AsyncZeroconf."""
from zeroconf import DNSCache, Zeroconf # pylint: disable=import-outside-toplevel
from zeroconf.asyncio import ( # pylint: disable=import-outside-toplevel