diff --git a/script/scaffold/templates/config_flow/tests/test_config_flow.py b/script/scaffold/templates/config_flow/tests/test_config_flow.py index 6af4bf1e6675c9..d6806d40a8a3c5 100644 --- a/script/scaffold/templates/config_flow/tests/test_config_flow.py +++ b/script/scaffold/templates/config_flow/tests/test_config_flow.py @@ -11,8 +11,8 @@ from homeassistant.data_entry_flow import FlowResultType -@pytest.fixture(autouse=True, name="mock_setup_entry") -def override_async_setup_entry() -> Generator[AsyncMock, None, None]: +@pytest.fixture(autouse=True) +def mock_setup_entry() -> Generator[AsyncMock, None, None]: """Override async_setup_entry.""" with patch( "homeassistant.components.NEW_DOMAIN.async_setup_entry", return_value=True diff --git a/script/scaffold/templates/config_flow_helper/tests/test_config_flow.py b/script/scaffold/templates/config_flow_helper/tests/test_config_flow.py index ba7efff5b6c61c..c924ed02b6e1f6 100644 --- a/script/scaffold/templates/config_flow_helper/tests/test_config_flow.py +++ b/script/scaffold/templates/config_flow_helper/tests/test_config_flow.py @@ -12,8 +12,8 @@ from tests.common import MockConfigEntry -@pytest.fixture(autouse=True, name="mock_setup_entry") -def override_async_setup_entry() -> Generator[AsyncMock, None, None]: +@pytest.fixture(autouse=True) +def mock_setup_entry() -> Generator[AsyncMock, None, None]: """Override async_setup_entry.""" with patch( "homeassistant.components.NEW_DOMAIN.async_setup_entry", return_value=True diff --git a/tests/components/nibe_heatpump/test_config_flow.py b/tests/components/nibe_heatpump/test_config_flow.py index 9263919214d3a4..183130f07a07db 100644 --- a/tests/components/nibe_heatpump/test_config_flow.py +++ b/tests/components/nibe_heatpump/test_config_flow.py @@ -1,5 +1,6 @@ """Test the Nibe Heat Pump config flow.""" -from unittest.mock import Mock, patch +from collections.abc import Generator +from unittest.mock import AsyncMock, Mock, patch from nibe.coil import Coil from nibe.exceptions import ( @@ -32,8 +33,8 @@ } -@pytest.fixture(autouse=True, name="mock_setup_entry") -async def fixture_mock_setup(): +@pytest.fixture(autouse=True) +def mock_setup_entry() -> Generator[AsyncMock, None, None]: """Make sure we never actually run setup.""" with patch( "homeassistant.components.nibe_heatpump.async_setup_entry", return_value=True diff --git a/tests/components/onewire/test_config_flow.py b/tests/components/onewire/test_config_flow.py index eab44bc5d48cd2..caed47cf0977ce 100644 --- a/tests/components/onewire/test_config_flow.py +++ b/tests/components/onewire/test_config_flow.py @@ -20,8 +20,8 @@ from .const import MOCK_OWPROXY_DEVICES -@pytest.fixture(autouse=True, name="mock_setup_entry") -def override_async_setup_entry() -> Generator[AsyncMock, None, None]: +@pytest.fixture(autouse=True) +def mock_setup_entry() -> Generator[AsyncMock, None, None]: """Override async_setup_entry.""" with patch( "homeassistant.components.onewire.async_setup_entry", return_value=True diff --git a/tests/components/philips_js/test_config_flow.py b/tests/components/philips_js/test_config_flow.py index d4a08aa6886d26..2c44bf160edba2 100644 --- a/tests/components/philips_js/test_config_flow.py +++ b/tests/components/philips_js/test_config_flow.py @@ -1,5 +1,6 @@ """Test the Philips TV config flow.""" -from unittest.mock import ANY, patch +from collections.abc import Generator +from unittest.mock import ANY, AsyncMock, patch from haphilipsjs import PairingFailure import pytest @@ -20,8 +21,8 @@ from tests.common import MockConfigEntry -@pytest.fixture(autouse=True, name="mock_setup_entry") -def mock_setup_entry_fixture(): +@pytest.fixture(autouse=True) +def mock_setup_entry() -> Generator[AsyncMock, None, None]: """Disable component setup.""" with patch( "homeassistant.components.philips_js.async_setup_entry", return_value=True diff --git a/tests/components/renault/test_config_flow.py b/tests/components/renault/test_config_flow.py index 39d4add062fe06..757b3239a7f1b9 100644 --- a/tests/components/renault/test_config_flow.py +++ b/tests/components/renault/test_config_flow.py @@ -1,4 +1,5 @@ """Test the Renault config flow.""" +from collections.abc import Generator from unittest.mock import AsyncMock, PropertyMock, patch import pytest @@ -22,8 +23,8 @@ from tests.common import load_fixture -@pytest.fixture(autouse=True, name="mock_setup_entry") -def override_async_setup_entry() -> AsyncMock: +@pytest.fixture(autouse=True) +def mock_setup_entry() -> Generator[AsyncMock, None, None]: """Override async_setup_entry.""" with patch( "homeassistant.components.renault.async_setup_entry", return_value=True diff --git a/tests/components/samsungtv/test_config_flow.py b/tests/components/samsungtv/test_config_flow.py index e84b3d30cb1ec2..32e9cef9968dc3 100644 --- a/tests/components/samsungtv/test_config_flow.py +++ b/tests/components/samsungtv/test_config_flow.py @@ -217,8 +217,8 @@ } -@pytest.fixture(autouse=True, name="mock_setup_entry") -def override_async_setup_entry() -> Generator[AsyncMock, None, None]: +@pytest.fixture(autouse=True) +def mock_setup_entry() -> Generator[AsyncMock, None, None]: """Override async_setup_entry.""" with patch( "homeassistant.components.samsungtv.async_setup_entry", return_value=True diff --git a/tests/components/sfr_box/test_config_flow.py b/tests/components/sfr_box/test_config_flow.py index e75e5a42c7d6cd..2d8e256de72843 100644 --- a/tests/components/sfr_box/test_config_flow.py +++ b/tests/components/sfr_box/test_config_flow.py @@ -16,8 +16,8 @@ from tests.common import load_fixture -@pytest.fixture(autouse=True, name="mock_setup_entry") -def override_async_setup_entry() -> Generator[AsyncMock, None, None]: +@pytest.fixture(autouse=True) +def mock_setup_entry() -> Generator[AsyncMock, None, None]: """Override async_setup_entry.""" with patch( "homeassistant.components.sfr_box.async_setup_entry", return_value=True diff --git a/tests/components/sleepiq/test_config_flow.py b/tests/components/sleepiq/test_config_flow.py index a2191b56583bdc..f8a0a9bb05d558 100644 --- a/tests/components/sleepiq/test_config_flow.py +++ b/tests/components/sleepiq/test_config_flow.py @@ -13,8 +13,8 @@ from .conftest import SLEEPIQ_CONFIG, setup_platform -@pytest.fixture(autouse=True, name="mock_setup_entry") -def override_async_setup_entry() -> Generator[AsyncMock, None, None]: +@pytest.fixture(autouse=True) +def mock_setup_entry() -> Generator[AsyncMock, None, None]: """Override async_setup_entry.""" with patch( "homeassistant.components.sleepiq.async_setup_entry", return_value=True