mirror of
https://github.com/home-assistant/core.git
synced 2025-11-14 05:20:17 +00:00
Add type hints for FixtureRequest in tests (#118779)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""The tests for the InfluxDB component."""
|
||||
|
||||
from collections.abc import Generator
|
||||
from dataclasses import dataclass
|
||||
import datetime
|
||||
from http import HTTPStatus
|
||||
@@ -51,7 +52,9 @@ def mock_batch_timeout(hass, monkeypatch):
|
||||
|
||||
|
||||
@pytest.fixture(name="mock_client")
|
||||
def mock_client_fixture(request):
|
||||
def mock_client_fixture(
|
||||
request: pytest.FixtureRequest,
|
||||
) -> Generator[MagicMock, None, None]:
|
||||
"""Patch the InfluxDBClient object with mock for version under test."""
|
||||
if request.param == influxdb.API_VERSION_2:
|
||||
client_target = f"{INFLUX_CLIENT_PATH}V2"
|
||||
@@ -63,7 +66,7 @@ def mock_client_fixture(request):
|
||||
|
||||
|
||||
@pytest.fixture(name="get_mock_call")
|
||||
def get_mock_call_fixture(request):
|
||||
def get_mock_call_fixture(request: pytest.FixtureRequest):
|
||||
"""Get version specific lambda to make write API call mock."""
|
||||
|
||||
def v2_call(body, precision):
|
||||
|
||||
Reference in New Issue
Block a user