Cleanup unused FixtureRequest in tests (#118780)

This commit is contained in:
epenet 2024-06-04 11:49:21 +02:00 committed by GitHub
parent fce5f2a93f
commit 3ac0fa53c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 11 additions and 8 deletions

View File

@ -28,7 +28,7 @@ MOCK_ENVIRON = {"SUPERVISOR": "127.0.0.1", "SUPERVISOR_TOKEN": "abcdefgh"}
@pytest.fixture(autouse=True)
def mock_all(aioclient_mock: AiohttpClientMocker, request):
def mock_all(aioclient_mock: AiohttpClientMocker) -> None:
"""Mock all setup requests."""
_install_default_mocks(aioclient_mock)
_install_test_addon_stats_mock(aioclient_mock)

View File

@ -1,10 +1,12 @@
"""HomeKit controller session fixtures."""
from collections.abc import Generator
import datetime
import unittest.mock
from aiohomekit.testing import FakeController
from freezegun import freeze_time
from freezegun.api import FrozenDateTimeFactory
import pytest
import homeassistant.util.dt as dt_util
@ -15,7 +17,7 @@ pytest.register_assert_rewrite("tests.components.homekit_controller.common")
@pytest.fixture(autouse=True)
def freeze_time_in_future(request):
def freeze_time_in_future() -> Generator[FrozenDateTimeFactory, None, None]:
"""Freeze time at a known point."""
now = dt_util.utcnow()
start_dt = datetime.datetime(now.year + 1, 1, 1, 0, 0, 0, tzinfo=now.tzinfo)

View File

@ -1,5 +1,6 @@
"""Tests for IPMA config flow."""
from collections.abc import Generator
from unittest.mock import patch
from pyipma import IPMAException
@ -15,7 +16,7 @@ from tests.components.ipma import MockLocation
@pytest.fixture(name="ipma_setup", autouse=True)
def ipma_setup_fixture(request):
def ipma_setup_fixture() -> Generator[None, None, None]:
"""Patch ipma setup entry."""
with patch("homeassistant.components.ipma.async_setup_entry", return_value=True):
yield

View File

@ -266,7 +266,7 @@ def mock_config_entry() -> MockConfigEntry:
@pytest.fixture
async def knx(request, hass, mock_config_entry: MockConfigEntry):
async def knx(hass: HomeAssistant, mock_config_entry: MockConfigEntry):
"""Create a KNX TestKit instance."""
knx_test_kit = KNXTestKit(hass, mock_config_entry)
yield knx_test_kit

View File

@ -74,7 +74,7 @@ def device_fixture() -> str:
@pytest.fixture
def mock_lametric(request, device_fixture: str) -> Generator[MagicMock, None, None]:
def mock_lametric(device_fixture: str) -> Generator[MagicMock, None, None]:
"""Return a mocked LaMetric TIME client."""
with (
patch(

View File

@ -196,7 +196,7 @@ def subscriber_id() -> str:
@pytest.fixture
def nest_test_config(request) -> NestTestConfig:
def nest_test_config() -> NestTestConfig:
"""Fixture that sets up the configuration used for the test."""
return TEST_CONFIG_APP_CREDS

View File

@ -48,7 +48,7 @@ FAKE_DHCP_DATA = dhcp.DhcpServiceInfo(
@pytest.fixture
def nest_test_config(request) -> NestTestConfig:
def nest_test_config() -> NestTestConfig:
"""Fixture with empty configuration and no existing config entry."""
return TEST_CONFIGFLOW_APP_CREDS

View File

@ -46,7 +46,7 @@ def mock_setup_entry() -> Generator[AsyncMock, None, None]:
@pytest.fixture
def mock_tedee(request) -> Generator[MagicMock, None, None]:
def mock_tedee() -> Generator[MagicMock, None, None]:
"""Return a mocked Tedee client."""
with (
patch(