diff --git a/tests/components/fujitsu_fglair/conftest.py b/tests/components/fujitsu_fglair/conftest.py index b73007a566b..04042fb0b09 100644 --- a/tests/components/fujitsu_fglair/conftest.py +++ b/tests/components/fujitsu_fglair/conftest.py @@ -30,7 +30,7 @@ TEST_PROPERTY_VALUES = { @pytest.fixture -def mock_setup_entry() -> Generator[AsyncMock, None, None]: +def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( "homeassistant.components.fujitsu_fglair.async_setup_entry", return_value=True diff --git a/tests/components/google_photos/conftest.py b/tests/components/google_photos/conftest.py index 9dbe85bd25b..3ca64471fa1 100644 --- a/tests/components/google_photos/conftest.py +++ b/tests/components/google_photos/conftest.py @@ -125,7 +125,7 @@ def mock_client_api( fixture_name: str, user_identifier: str, api_error: Exception, -) -> Generator[Mock, None, None]: +) -> Generator[Mock]: """Set up fake Google Photos API responses from fixtures.""" mock_api = AsyncMock(GooglePhotosLibraryApi, autospec=True) mock_api.get_user_info.return_value = UserInfoResult( @@ -136,9 +136,7 @@ def mock_client_api( responses = load_json_array_fixture(fixture_name, DOMAIN) if fixture_name else [] - async def list_media_items( - *args: Any, - ) -> AsyncGenerator[ListMediaItemResult, None, None]: + async def list_media_items(*args: Any) -> AsyncGenerator[ListMediaItemResult]: for response in responses: mock_list_media_items = Mock(ListMediaItemResult) mock_list_media_items.media_items = [ @@ -163,9 +161,7 @@ def mock_client_api( # Emulate an async iterator for returning pages of response objects. We just # return a single page. - async def list_albums( - *args: Any, **kwargs: Any - ) -> AsyncGenerator[ListAlbumResult, None, None]: + async def list_albums(*args: Any, **kwargs: Any) -> AsyncGenerator[ListAlbumResult]: mock_list_album_result = Mock(ListAlbumResult) mock_list_album_result.albums = [ Album.from_dict(album) diff --git a/tests/components/google_photos/test_config_flow.py b/tests/components/google_photos/test_config_flow.py index be97d7658c6..48c8723df3c 100644 --- a/tests/components/google_photos/test_config_flow.py +++ b/tests/components/google_photos/test_config_flow.py @@ -28,7 +28,7 @@ CLIENT_SECRET = "5678" @pytest.fixture(name="mock_setup") -def mock_setup_entry() -> Generator[Mock, None, None]: +def mock_setup_entry() -> Generator[Mock]: """Fixture to mock out integration setup.""" with patch( "homeassistant.components.google_photos.async_setup_entry", return_value=True @@ -37,7 +37,7 @@ def mock_setup_entry() -> Generator[Mock, None, None]: @pytest.fixture(autouse=True) -def mock_patch_api(mock_api: Mock) -> Generator[None, None, None]: +def mock_patch_api(mock_api: Mock) -> Generator[None]: """Fixture to patch the config flow api.""" with patch( "homeassistant.components.google_photos.config_flow.GooglePhotosLibraryApi", diff --git a/tests/components/intellifire/conftest.py b/tests/components/intellifire/conftest.py index 251d5bdde48..0bd7073ee47 100644 --- a/tests/components/intellifire/conftest.py +++ b/tests/components/intellifire/conftest.py @@ -34,7 +34,7 @@ from tests.common import MockConfigEntry, load_json_object_fixture @pytest.fixture -def mock_setup_entry() -> Generator[AsyncMock, None, None]: +def mock_setup_entry() -> Generator[AsyncMock]: """Mock setting up a config entry.""" with patch( "homeassistant.components.intellifire.async_setup_entry", return_value=True @@ -43,7 +43,7 @@ def mock_setup_entry() -> Generator[AsyncMock, None, None]: @pytest.fixture -def mock_fireplace_finder_none() -> Generator[None, MagicMock, None]: +def mock_fireplace_finder_none() -> Generator[MagicMock]: """Mock fireplace finder.""" mock_found_fireplaces = Mock() mock_found_fireplaces.ips = [] @@ -110,7 +110,7 @@ def mock_common_data_local() -> IntelliFireCommonFireplaceData: @pytest.fixture def mock_apis_multifp( mock_cloud_interface, mock_local_interface, mock_fp -) -> Generator[tuple[AsyncMock, AsyncMock, MagicMock], None, None]: +) -> Generator[tuple[AsyncMock, AsyncMock, MagicMock]]: """Multi fireplace version of mocks.""" return mock_local_interface, mock_cloud_interface, mock_fp @@ -118,7 +118,7 @@ def mock_apis_multifp( @pytest.fixture def mock_apis_single_fp( mock_cloud_interface, mock_local_interface, mock_fp -) -> Generator[tuple[AsyncMock, AsyncMock, MagicMock], None, None]: +) -> Generator[tuple[AsyncMock, AsyncMock, MagicMock]]: """Single fire place version of the mocks.""" data_v1 = IntelliFireUserData( **load_json_object_fixture("user_data_1.json", DOMAIN) @@ -131,7 +131,7 @@ def mock_apis_single_fp( @pytest.fixture -def mock_cloud_interface() -> Generator[AsyncMock, None, None]: +def mock_cloud_interface() -> Generator[AsyncMock]: """Mock cloud interface to use for testing.""" user_data = IntelliFireUserData( **load_json_object_fixture("user_data_3.json", DOMAIN) @@ -165,7 +165,7 @@ def mock_cloud_interface() -> Generator[AsyncMock, None, None]: @pytest.fixture -def mock_local_interface() -> Generator[AsyncMock, None, None]: +def mock_local_interface() -> Generator[AsyncMock]: """Mock version of IntelliFireAPILocal.""" poll_data = IntelliFirePollData( **load_json_object_fixture("intellifire/local_poll.json") @@ -181,7 +181,7 @@ def mock_local_interface() -> Generator[AsyncMock, None, None]: @pytest.fixture -def mock_fp(mock_common_data_local) -> Generator[AsyncMock, None, None]: +def mock_fp(mock_common_data_local) -> Generator[AsyncMock]: """Mock fireplace.""" local_poll_data = IntelliFirePollData( diff --git a/tests/components/smlight/conftest.py b/tests/components/smlight/conftest.py index ad4d749c0d2..c51da5c5ee5 100644 --- a/tests/components/smlight/conftest.py +++ b/tests/components/smlight/conftest.py @@ -39,14 +39,14 @@ def platforms() -> list[Platform]: @pytest.fixture(autouse=True) -async def mock_patch_platforms(platforms: list[str]) -> AsyncGenerator[None, None]: +async def mock_patch_platforms(platforms: list[str]) -> AsyncGenerator[None]: """Fixture to set up platforms for tests.""" with patch(f"homeassistant.components.{DOMAIN}.PLATFORMS", platforms): yield @pytest.fixture -def mock_setup_entry() -> Generator[AsyncMock, None, None]: +def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( "homeassistant.components.smlight.async_setup_entry", return_value=True diff --git a/tests/components/yale/test_config_flow.py b/tests/components/yale/test_config_flow.py index 163f8240553..004162c0ebf 100644 --- a/tests/components/yale/test_config_flow.py +++ b/tests/components/yale/test_config_flow.py @@ -25,7 +25,7 @@ CLIENT_ID = "1" @pytest.fixture -def mock_setup_entry() -> Generator[Mock, None, None]: +def mock_setup_entry() -> Generator[Mock]: """Patch setup entry.""" with patch( "homeassistant.components.yale.async_setup_entry", return_value=True