Add type hints for FixtureRequest in tests (#118779)

This commit is contained in:
epenet 2024-06-04 10:37:54 +02:00 committed by GitHub
parent 16fd19f01a
commit b54a68750b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 67 additions and 36 deletions

View file

@ -2,6 +2,7 @@
from __future__ import annotations
from collections.abc import Generator
from dataclasses import dataclass
from datetime import timedelta
from http import HTTPStatus
@ -79,7 +80,9 @@ class Table:
@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 == API_VERSION_2:
client_target = f"{INFLUXDB_CLIENT_PATH}V2"