Fix invalid tuple annotations (#116035)

This commit is contained in:
Marc Mueller 2024-04-23 16:02:16 +02:00 committed by GitHub
parent d367bc63f0
commit a0314cddd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 11 additions and 11 deletions

View File

@ -125,13 +125,13 @@ class ImapMessage:
return str(part.get_payload())
@property
def headers(self) -> dict[str, tuple[str,]]:
def headers(self) -> dict[str, tuple[str, ...]]:
"""Get the email headers."""
header_base: dict[str, tuple[str,]] = {}
header_base: dict[str, tuple[str, ...]] = {}
for key, value in self.email_message.items():
header_instances: tuple[str,] = (str(value),)
header_instances: tuple[str, ...] = (str(value),)
if header_base.setdefault(key, header_instances) != header_instances:
header_base[key] += header_instances # type: ignore[assignment]
header_base[key] += header_instances
return header_base
@property

View File

@ -663,9 +663,9 @@ async def test_is_on(hass: HomeAssistant) -> None:
)
async def test_is_on_and_state_mixed_domains(
hass: HomeAssistant,
domains: tuple[str,],
states_old: tuple[str,],
states_new: tuple[str,],
domains: tuple[str, ...],
states_old: tuple[str, ...],
states_new: tuple[str, ...],
state_ison_group_old: tuple[str, bool],
state_ison_group_new: tuple[str, bool],
) -> None:

View File

@ -83,7 +83,7 @@ def help_all_subscribe_calls(mqtt_client_mock: MqttMockPahoClient) -> list[Any]:
def help_custom_config(
mqtt_entity_domain: str,
mqtt_base_config: ConfigType,
mqtt_entity_configs: Iterable[ConfigType,],
mqtt_entity_configs: Iterable[ConfigType],
) -> ConfigType:
"""Tweak a default config for parametrization.

View File

@ -236,7 +236,7 @@ async def test_warning_if_color_mode_flags_are_used(
hass: HomeAssistant,
mqtt_mock_entry: MqttMockHAClientGenerator,
caplog: pytest.LogCaptureFixture,
color_modes: tuple[str,],
color_modes: tuple[str, ...],
) -> None:
"""Test warnings deprecated config keys without supported color modes defined."""
with patch(
@ -278,7 +278,7 @@ async def test_warning_on_discovery_if_color_mode_flags_are_used(
mqtt_mock_entry: MqttMockHAClientGenerator,
caplog: pytest.LogCaptureFixture,
config: dict[str, Any],
color_modes: tuple[str,],
color_modes: tuple[str, ...],
) -> None:
"""Test warnings deprecated config keys with discovery."""
with patch(

View File

@ -102,7 +102,7 @@ def test_template_message(arg: str | Exception, expected: str) -> None:
)
async def test_home_assistant_error(
hass: HomeAssistant,
exception_args: tuple[Any,],
exception_args: tuple[Any, ...],
exception_kwargs: dict[str, Any],
args_base_class: tuple[Any],
message: str,