mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 23:27:37 +00:00
Fix mock typing for Discovergy (#104047)
This commit is contained in:
parent
38961c6ddc
commit
cf985a8702
@ -1,4 +1,5 @@
|
|||||||
"""Fixtures for Discovergy integration tests."""
|
"""Fixtures for Discovergy integration tests."""
|
||||||
|
from collections.abc import Generator
|
||||||
from unittest.mock import AsyncMock, patch
|
from unittest.mock import AsyncMock, patch
|
||||||
|
|
||||||
from pydiscovergy import Discovergy
|
from pydiscovergy import Discovergy
|
||||||
@ -24,7 +25,7 @@ def _meter_last_reading(meter_id: str) -> Reading:
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="discovergy")
|
@pytest.fixture(name="discovergy")
|
||||||
def mock_discovergy() -> None:
|
def mock_discovergy() -> Generator[AsyncMock, None, None]:
|
||||||
"""Mock the pydiscovergy client."""
|
"""Mock the pydiscovergy client."""
|
||||||
mock = AsyncMock(spec=Discovergy)
|
mock = AsyncMock(spec=Discovergy)
|
||||||
mock.meters.return_value = GET_METERS
|
mock.meters.return_value = GET_METERS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user