From 281c66b6c216dc0ed2c2f2afa3feb08970e6f7d4 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 19 Jul 2024 14:45:42 +0200 Subject: [PATCH] Fix invalid dict annotations in tests (#122178) --- tests/components/auth/test_init.py | 4 ++-- tests/components/coolmaster/conftest.py | 2 +- tests/components/ecovacs/test_services.py | 2 +- tests/components/ourgroceries/__init__.py | 6 +++++- tests/components/unifi/test_device_tracker.py | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/components/auth/test_init.py b/tests/components/auth/test_init.py index d0ca4699e0e..0f4908c2fc0 100644 --- a/tests/components/auth/test_init.py +++ b/tests/components/auth/test_init.py @@ -598,8 +598,8 @@ async def test_ws_delete_all_refresh_tokens( hass_admin_credential: Credentials, hass_ws_client: WebSocketGenerator, hass_access_token: str, - delete_token_type: dict[str:str], - delete_current_token: dict[str:bool], + delete_token_type: dict[str, str], + delete_current_token: dict[str, bool], expected_remaining_normal_tokens: int, expected_remaining_long_lived_tokens: int, ) -> None: diff --git a/tests/components/coolmaster/conftest.py b/tests/components/coolmaster/conftest.py index 15670af4bc8..27a801288b0 100644 --- a/tests/components/coolmaster/conftest.py +++ b/tests/components/coolmaster/conftest.py @@ -18,7 +18,7 @@ DEFAULT_INFO: dict[str, str] = { "version": "1", } -TEST_UNITS: dict[dict[str, Any]] = { +TEST_UNITS: dict[str, dict[str, Any]] = { "L1.100": { "is_on": False, "thermostat": 20, diff --git a/tests/components/ecovacs/test_services.py b/tests/components/ecovacs/test_services.py index 19e8237be03..6fd10cde6d9 100644 --- a/tests/components/ecovacs/test_services.py +++ b/tests/components/ecovacs/test_services.py @@ -71,7 +71,7 @@ def mock_device_execute_response(data: dict[str, Any]) -> Generator[dict[str, An ) async def test_get_positions_service( hass: HomeAssistant, - mock_device_execute_response: dict[str], + mock_device_execute_response: dict[str, Any], entity_id: str, ) -> None: """Test that get_positions service response snapshots match.""" diff --git a/tests/components/ourgroceries/__init__.py b/tests/components/ourgroceries/__init__.py index 6f90cb7ea1b..4ebbea46229 100644 --- a/tests/components/ourgroceries/__init__.py +++ b/tests/components/ourgroceries/__init__.py @@ -1,6 +1,10 @@ """Tests for the OurGroceries integration.""" +from typing import Any -def items_to_shopping_list(items: list, version_id: str = "1") -> dict[dict[list]]: + +def items_to_shopping_list( + items: list, version_id: str = "1" +) -> dict[str, dict[str, Any]]: """Convert a list of items into a shopping list.""" return {"list": {"versionId": version_id, "items": items}} diff --git a/tests/components/unifi/test_device_tracker.py b/tests/components/unifi/test_device_tracker.py index 0b20822bea4..615afb61bb6 100644 --- a/tests/components/unifi/test_device_tracker.py +++ b/tests/components/unifi/test_device_tracker.py @@ -627,7 +627,7 @@ async def test_config_entry_options_track( config_entry_setup: ConfigEntry, config_entry_options: MappingProxyType[str, Any], counts: tuple[int], - expected: dict[tuple[bool | None]], + expected: tuple[tuple[bool | None, ...], ...], ) -> None: """Test the different config entry options. -- GitLab