Fix mock typing for Discovergy (#104047)

This commit is contained in:
Jan-Philipp Benecke 2023-11-16 14:43:02 +01:00 committed by GitHub
parent 38961c6ddc
commit cf985a8702
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
"""Fixtures for Discovergy integration tests."""
from collections.abc import Generator
from unittest.mock import AsyncMock, patch
from pydiscovergy import Discovergy
@ -24,7 +25,7 @@ def _meter_last_reading(meter_id: str) -> Reading:
@pytest.fixture(name="discovergy")
def mock_discovergy() -> None:
def mock_discovergy() -> Generator[AsyncMock, None, None]:
"""Mock the pydiscovergy client."""
mock = AsyncMock(spec=Discovergy)
mock.meters.return_value = GET_METERS