Add type hints to root tests (#89785)

This commit is contained in:
epenet 2023-03-16 11:08:47 +01:00 committed by GitHub
parent 8a58457203
commit fec6236dd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 214 additions and 117 deletions

View File

@ -1,9 +1,10 @@
"""Test the bootstrapping.""" """Test the bootstrapping."""
import asyncio import asyncio
from collections.abc import Generator
import glob import glob
import os import os
from unittest.mock import Mock, patch from typing import Any
from unittest.mock import AsyncMock, Mock, patch
import pytest import pytest
@ -27,7 +28,7 @@ VERSION_PATH = os.path.join(get_test_config_dir(), config_util.VERSION_FILE)
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def apply_mock_storage(hass_storage): def apply_mock_storage(hass_storage: dict[str, Any]) -> None:
"""Apply the storage mock.""" """Apply the storage mock."""
@ -37,7 +38,7 @@ async def apply_stop_hass(stop_hass: None) -> None:
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def mock_http_start_stop(): def mock_http_start_stop() -> Generator[None, None, None]:
"""Mock HTTP start and stop.""" """Mock HTTP start and stop."""
with patch( with patch(
"homeassistant.components.http.start_http_server_and_save_config" "homeassistant.components.http.start_http_server_and_save_config"
@ -416,8 +417,8 @@ async def test_setup_after_deps_not_present(hass: HomeAssistant) -> None:
@pytest.fixture @pytest.fixture
def mock_is_virtual_env(): def mock_is_virtual_env() -> Generator[Mock, None, None]:
"""Mock enable logging.""" """Mock is_virtual_env."""
with patch( with patch(
"homeassistant.bootstrap.is_virtual_env", return_value=False "homeassistant.bootstrap.is_virtual_env", return_value=False
) as is_virtual_env: ) as is_virtual_env:
@ -425,14 +426,14 @@ def mock_is_virtual_env():
@pytest.fixture @pytest.fixture
def mock_enable_logging(): def mock_enable_logging() -> Generator[Mock, None, None]:
"""Mock enable logging.""" """Mock enable logging."""
with patch("homeassistant.bootstrap.async_enable_logging") as enable_logging: with patch("homeassistant.bootstrap.async_enable_logging") as enable_logging:
yield enable_logging yield enable_logging
@pytest.fixture @pytest.fixture
def mock_mount_local_lib_path(): def mock_mount_local_lib_path() -> Generator[AsyncMock, None, None]:
"""Mock enable logging.""" """Mock enable logging."""
with patch( with patch(
"homeassistant.bootstrap.async_mount_local_lib_path" "homeassistant.bootstrap.async_mount_local_lib_path"
@ -441,7 +442,7 @@ def mock_mount_local_lib_path():
@pytest.fixture @pytest.fixture
def mock_process_ha_config_upgrade(): def mock_process_ha_config_upgrade() -> Generator[Mock, None, None]:
"""Mock enable logging.""" """Mock enable logging."""
with patch( with patch(
"homeassistant.config.process_ha_config_upgrade" "homeassistant.config.process_ha_config_upgrade"
@ -450,7 +451,7 @@ def mock_process_ha_config_upgrade():
@pytest.fixture @pytest.fixture
def mock_ensure_config_exists(): def mock_ensure_config_exists() -> Generator[AsyncMock, None, None]:
"""Mock enable logging.""" """Mock enable logging."""
with patch( with patch(
"homeassistant.config.async_ensure_config_exists", return_value=True "homeassistant.config.async_ensure_config_exists", return_value=True
@ -461,13 +462,13 @@ def mock_ensure_config_exists():
@pytest.mark.parametrize("hass_config", [{"browser": {}, "frontend": {}}]) @pytest.mark.parametrize("hass_config", [{"browser": {}, "frontend": {}}])
async def test_setup_hass( async def test_setup_hass(
mock_hass_config: None, mock_hass_config: None,
mock_enable_logging, mock_enable_logging: Mock,
mock_is_virtual_env, mock_is_virtual_env: Mock,
mock_mount_local_lib_path, mock_mount_local_lib_path: AsyncMock,
mock_ensure_config_exists, mock_ensure_config_exists: AsyncMock,
mock_process_ha_config_upgrade, mock_process_ha_config_upgrade: Mock,
caplog: pytest.LogCaptureFixture, caplog: pytest.LogCaptureFixture,
event_loop, event_loop: asyncio.AbstractEventLoop,
) -> None: ) -> None:
"""Test it works.""" """Test it works."""
verbose = Mock() verbose = Mock()
@ -511,13 +512,13 @@ async def test_setup_hass(
@pytest.mark.parametrize("hass_config", [{"browser": {}, "frontend": {}}]) @pytest.mark.parametrize("hass_config", [{"browser": {}, "frontend": {}}])
async def test_setup_hass_takes_longer_than_log_slow_startup( async def test_setup_hass_takes_longer_than_log_slow_startup(
mock_hass_config: None, mock_hass_config: None,
mock_enable_logging, mock_enable_logging: Mock,
mock_is_virtual_env, mock_is_virtual_env: Mock,
mock_mount_local_lib_path, mock_mount_local_lib_path: AsyncMock,
mock_ensure_config_exists, mock_ensure_config_exists: AsyncMock,
mock_process_ha_config_upgrade, mock_process_ha_config_upgrade: Mock,
caplog: pytest.LogCaptureFixture, caplog: pytest.LogCaptureFixture,
event_loop, event_loop: asyncio.AbstractEventLoop,
) -> None: ) -> None:
"""Test it works.""" """Test it works."""
verbose = Mock() verbose = Mock()
@ -551,12 +552,12 @@ async def test_setup_hass_takes_longer_than_log_slow_startup(
async def test_setup_hass_invalid_yaml( async def test_setup_hass_invalid_yaml(
mock_enable_logging, mock_enable_logging: Mock,
mock_is_virtual_env, mock_is_virtual_env: Mock,
mock_mount_local_lib_path, mock_mount_local_lib_path: AsyncMock,
mock_ensure_config_exists, mock_ensure_config_exists: AsyncMock,
mock_process_ha_config_upgrade, mock_process_ha_config_upgrade: Mock,
event_loop, event_loop: asyncio.AbstractEventLoop,
) -> None: ) -> None:
"""Test it works.""" """Test it works."""
with patch( with patch(
@ -579,12 +580,12 @@ async def test_setup_hass_invalid_yaml(
async def test_setup_hass_config_dir_nonexistent( async def test_setup_hass_config_dir_nonexistent(
mock_enable_logging, mock_enable_logging: Mock,
mock_is_virtual_env, mock_is_virtual_env: Mock,
mock_mount_local_lib_path, mock_mount_local_lib_path: AsyncMock,
mock_ensure_config_exists, mock_ensure_config_exists: AsyncMock,
mock_process_ha_config_upgrade, mock_process_ha_config_upgrade: Mock,
event_loop, event_loop: asyncio.AbstractEventLoop,
) -> None: ) -> None:
"""Test it works.""" """Test it works."""
mock_ensure_config_exists.return_value = False mock_ensure_config_exists.return_value = False
@ -606,12 +607,12 @@ async def test_setup_hass_config_dir_nonexistent(
async def test_setup_hass_safe_mode( async def test_setup_hass_safe_mode(
mock_enable_logging, mock_enable_logging: Mock,
mock_is_virtual_env, mock_is_virtual_env: Mock,
mock_mount_local_lib_path, mock_mount_local_lib_path: AsyncMock,
mock_ensure_config_exists, mock_ensure_config_exists: AsyncMock,
mock_process_ha_config_upgrade, mock_process_ha_config_upgrade: Mock,
event_loop, event_loop: asyncio.AbstractEventLoop,
) -> None: ) -> None:
"""Test it works.""" """Test it works."""
with patch("homeassistant.components.browser.setup") as browser_setup, patch( with patch("homeassistant.components.browser.setup") as browser_setup, patch(
@ -641,12 +642,12 @@ async def test_setup_hass_safe_mode(
@pytest.mark.parametrize("hass_config", [{"homeassistant": {"non-existing": 1}}]) @pytest.mark.parametrize("hass_config", [{"homeassistant": {"non-existing": 1}}])
async def test_setup_hass_invalid_core_config( async def test_setup_hass_invalid_core_config(
mock_hass_config: None, mock_hass_config: None,
mock_enable_logging, mock_enable_logging: Mock,
mock_is_virtual_env, mock_is_virtual_env: Mock,
mock_mount_local_lib_path, mock_mount_local_lib_path: AsyncMock,
mock_ensure_config_exists, mock_ensure_config_exists: AsyncMock,
mock_process_ha_config_upgrade, mock_process_ha_config_upgrade: Mock,
event_loop, event_loop: asyncio.AbstractEventLoop,
) -> None: ) -> None:
"""Test it works.""" """Test it works."""
hass = await bootstrap.async_setup_hass( hass = await bootstrap.async_setup_hass(
@ -679,12 +680,12 @@ async def test_setup_hass_invalid_core_config(
) )
async def test_setup_safe_mode_if_no_frontend( async def test_setup_safe_mode_if_no_frontend(
mock_hass_config: None, mock_hass_config: None,
mock_enable_logging, mock_enable_logging: Mock,
mock_is_virtual_env, mock_is_virtual_env: Mock,
mock_mount_local_lib_path, mock_mount_local_lib_path: AsyncMock,
mock_ensure_config_exists, mock_ensure_config_exists: AsyncMock,
mock_process_ha_config_upgrade, mock_process_ha_config_upgrade: Mock,
event_loop, event_loop: asyncio.AbstractEventLoop,
) -> None: ) -> None:
"""Test we setup safe mode if frontend didn't load.""" """Test we setup safe mode if frontend didn't load."""
verbose = Mock() verbose = Mock()

View File

@ -2,6 +2,7 @@
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio
from collections.abc import Generator
from datetime import timedelta from datetime import timedelta
import logging import logging
from typing import Any from typing import Any
@ -26,6 +27,8 @@ from homeassistant.exceptions import (
HomeAssistantError, HomeAssistantError,
) )
from homeassistant.helpers import entity_registry as er from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from homeassistant.setup import async_set_domains_to_be_loaded, async_setup_component from homeassistant.setup import async_set_domains_to_be_loaded, async_setup_component
from homeassistant.util import dt from homeassistant.util import dt
@ -44,7 +47,7 @@ from .common import (
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def mock_handlers(): def mock_handlers() -> Generator[None, None, None]:
"""Mock config flows.""" """Mock config flows."""
class MockFlowHandler(config_entries.ConfigFlow): class MockFlowHandler(config_entries.ConfigFlow):
@ -63,7 +66,7 @@ def mock_handlers():
@pytest.fixture @pytest.fixture
def manager(hass): def manager(hass: HomeAssistant) -> config_entries.ConfigEntries:
"""Fixture of a loaded config manager.""" """Fixture of a loaded config manager."""
manager = config_entries.ConfigEntries(hass, {}) manager = config_entries.ConfigEntries(hass, {})
hass.config_entries = manager hass.config_entries = manager
@ -263,15 +266,21 @@ async def test_call_async_migrate_entry_failure_not_supported(
assert not entry.supports_unload assert not entry.supports_unload
async def test_remove_entry(hass: HomeAssistant, manager) -> None: async def test_remove_entry(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we can remove an entry.""" """Test that we can remove an entry."""
async def mock_setup_entry(hass, entry): async def mock_setup_entry(
hass: HomeAssistant, entry: config_entries.ConfigEntry
) -> bool:
"""Mock setting up entry.""" """Mock setting up entry."""
hass.config_entries.async_setup_platforms(entry, ["light"]) hass.config_entries.async_setup_platforms(entry, ["light"])
return True return True
async def mock_unload_entry(hass, entry): async def mock_unload_entry(
hass: HomeAssistant, entry: config_entries.ConfigEntry
) -> bool:
"""Mock unloading an entry.""" """Mock unloading an entry."""
result = await hass.config_entries.async_unload_platforms(entry, ["light"]) result = await hass.config_entries.async_unload_platforms(entry, ["light"])
assert result assert result
@ -281,7 +290,11 @@ async def test_remove_entry(hass: HomeAssistant, manager) -> None:
entity = MockEntity(unique_id="1234", name="Test Entity") entity = MockEntity(unique_id="1234", name="Test Entity")
async def mock_setup_entry_platform(hass, entry, async_add_entities): async def mock_setup_entry_platform(
hass: HomeAssistant,
entry: config_entries.ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Mock setting up platform.""" """Mock setting up platform."""
async_add_entities([entity]) async_add_entities([entity])
@ -347,7 +360,9 @@ async def test_remove_entry(hass: HomeAssistant, manager) -> None:
assert not entity_entry_list assert not entity_entry_list
async def test_remove_entry_cancels_reauth(hass: HomeAssistant, manager) -> None: async def test_remove_entry_cancels_reauth(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Tests that removing a config entry, also aborts existing reauth flows.""" """Tests that removing a config entry, also aborts existing reauth flows."""
entry = MockConfigEntry(title="test_title", domain="test") entry = MockConfigEntry(title="test_title", domain="test")
@ -372,7 +387,7 @@ async def test_remove_entry_cancels_reauth(hass: HomeAssistant, manager) -> None
async def test_remove_entry_handles_callback_error( async def test_remove_entry_handles_callback_error(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that exceptions in the remove callback are handled.""" """Test that exceptions in the remove callback are handled."""
mock_setup_entry = AsyncMock(return_value=True) mock_setup_entry = AsyncMock(return_value=True)
@ -406,7 +421,9 @@ async def test_remove_entry_handles_callback_error(
assert [item.entry_id for item in manager.async_entries()] == [] assert [item.entry_id for item in manager.async_entries()] == []
async def test_remove_entry_raises(hass: HomeAssistant, manager) -> None: async def test_remove_entry_raises(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test if a component raises while removing entry.""" """Test if a component raises while removing entry."""
async def mock_unload_entry(hass, entry): async def mock_unload_entry(hass, entry):
@ -433,7 +450,9 @@ async def test_remove_entry_raises(hass: HomeAssistant, manager) -> None:
assert [item.entry_id for item in manager.async_entries()] == ["test1", "test3"] assert [item.entry_id for item in manager.async_entries()] == ["test1", "test3"]
async def test_remove_entry_if_not_loaded(hass: HomeAssistant, manager) -> None: async def test_remove_entry_if_not_loaded(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we can remove an entry that is not loaded.""" """Test that we can remove an entry that is not loaded."""
mock_unload_entry = AsyncMock(return_value=True) mock_unload_entry = AsyncMock(return_value=True)
@ -458,7 +477,7 @@ async def test_remove_entry_if_not_loaded(hass: HomeAssistant, manager) -> None:
async def test_remove_entry_if_integration_deleted( async def test_remove_entry_if_integration_deleted(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that we can remove an entry when the integration is deleted.""" """Test that we can remove an entry when the integration is deleted."""
mock_unload_entry = AsyncMock(return_value=True) mock_unload_entry = AsyncMock(return_value=True)
@ -481,7 +500,9 @@ async def test_remove_entry_if_integration_deleted(
assert len(mock_unload_entry.mock_calls) == 0 assert len(mock_unload_entry.mock_calls) == 0
async def test_add_entry_calls_setup_entry(hass: HomeAssistant, manager) -> None: async def test_add_entry_calls_setup_entry(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test we call setup_config_entry.""" """Test we call setup_config_entry."""
mock_setup_entry = AsyncMock(return_value=True) mock_setup_entry = AsyncMock(return_value=True)
@ -510,7 +531,7 @@ async def test_add_entry_calls_setup_entry(hass: HomeAssistant, manager) -> None
assert p_entry.data == {"token": "supersecret"} assert p_entry.data == {"token": "supersecret"}
async def test_entries_gets_entries(manager) -> None: async def test_entries_gets_entries(manager: config_entries.ConfigEntries) -> None:
"""Test entries are filtered by domain.""" """Test entries are filtered by domain."""
MockConfigEntry(domain="test").add_to_manager(manager) MockConfigEntry(domain="test").add_to_manager(manager)
entry1 = MockConfigEntry(domain="test2") entry1 = MockConfigEntry(domain="test2")
@ -521,7 +542,9 @@ async def test_entries_gets_entries(manager) -> None:
assert manager.async_entries("test2") == [entry1, entry2] assert manager.async_entries("test2") == [entry1, entry2]
async def test_domains_gets_domains_uniques(manager) -> None: async def test_domains_gets_domains_uniques(
manager: config_entries.ConfigEntries,
) -> None:
"""Test we only return each domain once.""" """Test we only return each domain once."""
MockConfigEntry(domain="test").add_to_manager(manager) MockConfigEntry(domain="test").add_to_manager(manager)
MockConfigEntry(domain="test2").add_to_manager(manager) MockConfigEntry(domain="test2").add_to_manager(manager)
@ -532,7 +555,9 @@ async def test_domains_gets_domains_uniques(manager) -> None:
assert manager.async_domains() == ["test", "test2", "test3"] assert manager.async_domains() == ["test", "test2", "test3"]
async def test_domains_gets_domains_excludes_ignore_and_disabled(manager) -> None: async def test_domains_gets_domains_excludes_ignore_and_disabled(
manager: config_entries.ConfigEntries,
) -> None:
"""Test we only return each domain once.""" """Test we only return each domain once."""
MockConfigEntry(domain="test").add_to_manager(manager) MockConfigEntry(domain="test").add_to_manager(manager)
MockConfigEntry(domain="test2").add_to_manager(manager) MockConfigEntry(domain="test2").add_to_manager(manager)
@ -838,7 +863,7 @@ async def test_loading_default_config(hass: HomeAssistant) -> None:
assert len(manager.async_entries()) == 0 assert len(manager.async_entries()) == 0
async def test_updating_entry_data(manager) -> None: async def test_updating_entry_data(manager: config_entries.ConfigEntries) -> None:
"""Test that we can update an entry data.""" """Test that we can update an entry data."""
entry = MockConfigEntry( entry = MockConfigEntry(
domain="test", domain="test",
@ -854,7 +879,9 @@ async def test_updating_entry_data(manager) -> None:
assert entry.data == {"second": True} assert entry.data == {"second": True}
async def test_updating_entry_system_options(manager) -> None: async def test_updating_entry_system_options(
manager: config_entries.ConfigEntries,
) -> None:
"""Test that we can update an entry data.""" """Test that we can update an entry data."""
entry = MockConfigEntry( entry = MockConfigEntry(
domain="test", domain="test",
@ -876,7 +903,7 @@ async def test_updating_entry_system_options(manager) -> None:
async def test_update_entry_options_and_trigger_listener( async def test_update_entry_options_and_trigger_listener(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that we can update entry options and trigger listener.""" """Test that we can update entry options and trigger listener."""
entry = MockConfigEntry(domain="test", options={"first": True}) entry = MockConfigEntry(domain="test", options={"first": True})
@ -1070,7 +1097,9 @@ async def test_create_entry_options(hass: HomeAssistant) -> None:
assert entries[0].options == {"example": "option"} assert entries[0].options == {"example": "option"}
async def test_entry_options(hass: HomeAssistant, manager) -> None: async def test_entry_options(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we can set options on an entry.""" """Test that we can set options on an entry."""
entry = MockConfigEntry(domain="test", data={"first": True}, options=None) entry = MockConfigEntry(domain="test", data={"first": True}, options=None)
entry.add_to_manager(manager) entry.add_to_manager(manager)
@ -1104,7 +1133,9 @@ async def test_entry_options(hass: HomeAssistant, manager) -> None:
assert entry.options == {"second": True} assert entry.options == {"second": True}
async def test_entry_options_abort(hass: HomeAssistant, manager) -> None: async def test_entry_options_abort(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we can abort options flow.""" """Test that we can abort options flow."""
entry = MockConfigEntry(domain="test", data={"first": True}, options=None) entry = MockConfigEntry(domain="test", data={"first": True}, options=None)
entry.add_to_manager(manager) entry.add_to_manager(manager)
@ -1134,7 +1165,9 @@ async def test_entry_options_abort(hass: HomeAssistant, manager) -> None:
) )
async def test_entry_setup_succeed(hass: HomeAssistant, manager) -> None: async def test_entry_setup_succeed(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we can setup an entry.""" """Test that we can setup an entry."""
entry = MockConfigEntry( entry = MockConfigEntry(
domain="comp", state=config_entries.ConfigEntryState.NOT_LOADED domain="comp", state=config_entries.ConfigEntryState.NOT_LOADED
@ -1166,7 +1199,11 @@ async def test_entry_setup_succeed(hass: HomeAssistant, manager) -> None:
config_entries.ConfigEntryState.FAILED_UNLOAD, config_entries.ConfigEntryState.FAILED_UNLOAD,
), ),
) )
async def test_entry_setup_invalid_state(hass: HomeAssistant, manager, state) -> None: async def test_entry_setup_invalid_state(
hass: HomeAssistant,
manager: config_entries.ConfigEntries,
state: config_entries.ConfigEntryState,
) -> None:
"""Test that we cannot setup an entry with invalid state.""" """Test that we cannot setup an entry with invalid state."""
entry = MockConfigEntry(domain="comp", state=state) entry = MockConfigEntry(domain="comp", state=state)
entry.add_to_hass(hass) entry.add_to_hass(hass)
@ -1187,7 +1224,9 @@ async def test_entry_setup_invalid_state(hass: HomeAssistant, manager, state) ->
assert entry.state is state assert entry.state is state
async def test_entry_unload_succeed(hass: HomeAssistant, manager) -> None: async def test_entry_unload_succeed(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we can unload an entry.""" """Test that we can unload an entry."""
entry = MockConfigEntry(domain="comp", state=config_entries.ConfigEntryState.LOADED) entry = MockConfigEntry(domain="comp", state=config_entries.ConfigEntryState.LOADED)
entry.add_to_hass(hass) entry.add_to_hass(hass)
@ -1209,7 +1248,11 @@ async def test_entry_unload_succeed(hass: HomeAssistant, manager) -> None:
config_entries.ConfigEntryState.SETUP_RETRY, config_entries.ConfigEntryState.SETUP_RETRY,
), ),
) )
async def test_entry_unload_failed_to_load(hass: HomeAssistant, manager, state) -> None: async def test_entry_unload_failed_to_load(
hass: HomeAssistant,
manager: config_entries.ConfigEntries,
state: config_entries.ConfigEntryState,
) -> None:
"""Test that we can unload an entry.""" """Test that we can unload an entry."""
entry = MockConfigEntry(domain="comp", state=state) entry = MockConfigEntry(domain="comp", state=state)
entry.add_to_hass(hass) entry.add_to_hass(hass)
@ -1230,7 +1273,11 @@ async def test_entry_unload_failed_to_load(hass: HomeAssistant, manager, state)
config_entries.ConfigEntryState.FAILED_UNLOAD, config_entries.ConfigEntryState.FAILED_UNLOAD,
), ),
) )
async def test_entry_unload_invalid_state(hass: HomeAssistant, manager, state) -> None: async def test_entry_unload_invalid_state(
hass: HomeAssistant,
manager: config_entries.ConfigEntries,
state: config_entries.ConfigEntryState,
) -> None:
"""Test that we cannot unload an entry with invalid state.""" """Test that we cannot unload an entry with invalid state."""
entry = MockConfigEntry(domain="comp", state=state) entry = MockConfigEntry(domain="comp", state=state)
entry.add_to_hass(hass) entry.add_to_hass(hass)
@ -1246,7 +1293,9 @@ async def test_entry_unload_invalid_state(hass: HomeAssistant, manager, state) -
assert entry.state is state assert entry.state is state
async def test_entry_reload_succeed(hass: HomeAssistant, manager) -> None: async def test_entry_reload_succeed(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we can reload an entry.""" """Test that we can reload an entry."""
entry = MockConfigEntry(domain="comp", state=config_entries.ConfigEntryState.LOADED) entry = MockConfigEntry(domain="comp", state=config_entries.ConfigEntryState.LOADED)
entry.add_to_hass(hass) entry.add_to_hass(hass)
@ -1281,7 +1330,11 @@ async def test_entry_reload_succeed(hass: HomeAssistant, manager) -> None:
config_entries.ConfigEntryState.SETUP_RETRY, config_entries.ConfigEntryState.SETUP_RETRY,
), ),
) )
async def test_entry_reload_not_loaded(hass: HomeAssistant, manager, state) -> None: async def test_entry_reload_not_loaded(
hass: HomeAssistant,
manager: config_entries.ConfigEntries,
state: config_entries.ConfigEntryState,
) -> None:
"""Test that we can reload an entry.""" """Test that we can reload an entry."""
entry = MockConfigEntry(domain="comp", state=state) entry = MockConfigEntry(domain="comp", state=state)
entry.add_to_hass(hass) entry.add_to_hass(hass)
@ -1315,7 +1368,11 @@ async def test_entry_reload_not_loaded(hass: HomeAssistant, manager, state) -> N
config_entries.ConfigEntryState.FAILED_UNLOAD, config_entries.ConfigEntryState.FAILED_UNLOAD,
), ),
) )
async def test_entry_reload_error(hass: HomeAssistant, manager, state) -> None: async def test_entry_reload_error(
hass: HomeAssistant,
manager: config_entries.ConfigEntries,
state: config_entries.ConfigEntryState,
) -> None:
"""Test that we can reload an entry.""" """Test that we can reload an entry."""
entry = MockConfigEntry(domain="comp", state=state) entry = MockConfigEntry(domain="comp", state=state)
entry.add_to_hass(hass) entry.add_to_hass(hass)
@ -1344,7 +1401,9 @@ async def test_entry_reload_error(hass: HomeAssistant, manager, state) -> None:
assert entry.state == state assert entry.state == state
async def test_entry_disable_succeed(hass: HomeAssistant, manager) -> None: async def test_entry_disable_succeed(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we can disable an entry.""" """Test that we can disable an entry."""
entry = MockConfigEntry(domain="comp", state=config_entries.ConfigEntryState.LOADED) entry = MockConfigEntry(domain="comp", state=config_entries.ConfigEntryState.LOADED)
entry.add_to_hass(hass) entry.add_to_hass(hass)
@ -1382,7 +1441,7 @@ async def test_entry_disable_succeed(hass: HomeAssistant, manager) -> None:
async def test_entry_disable_without_reload_support( async def test_entry_disable_without_reload_support(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that we can disable an entry without reload support.""" """Test that we can disable an entry without reload support."""
entry = MockConfigEntry(domain="comp", state=config_entries.ConfigEntryState.LOADED) entry = MockConfigEntry(domain="comp", state=config_entries.ConfigEntryState.LOADED)
@ -1421,7 +1480,7 @@ async def test_entry_disable_without_reload_support(
async def test_entry_enable_without_reload_support( async def test_entry_enable_without_reload_support(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that we can disable an entry without reload support.""" """Test that we can disable an entry without reload support."""
entry = MockConfigEntry( entry = MockConfigEntry(
@ -1550,7 +1609,9 @@ async def test_reload_entry_entity_registry_works(
assert len(mock_unload_entry.mock_calls) == 2 assert len(mock_unload_entry.mock_calls) == 2
async def test_unique_id_persisted(hass: HomeAssistant, manager) -> None: async def test_unique_id_persisted(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that a unique ID is stored in the config entry.""" """Test that a unique ID is stored in the config entry."""
mock_setup_entry = AsyncMock(return_value=True) mock_setup_entry = AsyncMock(return_value=True)
@ -1579,7 +1640,9 @@ async def test_unique_id_persisted(hass: HomeAssistant, manager) -> None:
assert p_entry.unique_id == "mock-unique-id" assert p_entry.unique_id == "mock-unique-id"
async def test_unique_id_existing_entry(hass: HomeAssistant, manager) -> None: async def test_unique_id_existing_entry(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we remove an entry if there already is an entry with unique ID.""" """Test that we remove an entry if there already is an entry with unique ID."""
hass.config.components.add("comp") hass.config.components.add("comp")
MockConfigEntry( MockConfigEntry(
@ -1632,7 +1695,9 @@ async def test_unique_id_existing_entry(hass: HomeAssistant, manager) -> None:
assert len(async_remove_entry.mock_calls) == 1 assert len(async_remove_entry.mock_calls) == 1
async def test_entry_id_existing_entry(hass: HomeAssistant, manager) -> None: async def test_entry_id_existing_entry(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we throw when the entry id collides.""" """Test that we throw when the entry id collides."""
collide_entry_id = "collide" collide_entry_id = "collide"
hass.config.components.add("comp") hass.config.components.add("comp")
@ -1670,7 +1735,7 @@ async def test_entry_id_existing_entry(hass: HomeAssistant, manager) -> None:
async def test_unique_id_update_existing_entry_without_reload( async def test_unique_id_update_existing_entry_without_reload(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that we update an entry if there already is an entry with unique ID.""" """Test that we update an entry if there already is an entry with unique ID."""
hass.config.components.add("comp") hass.config.components.add("comp")
@ -1716,7 +1781,7 @@ async def test_unique_id_update_existing_entry_without_reload(
async def test_unique_id_update_existing_entry_with_reload( async def test_unique_id_update_existing_entry_with_reload(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that we update an entry if there already is an entry with unique ID and we reload on changes.""" """Test that we update an entry if there already is an entry with unique ID and we reload on changes."""
hass.config.components.add("comp") hass.config.components.add("comp")
@ -1780,7 +1845,7 @@ async def test_unique_id_update_existing_entry_with_reload(
async def test_unique_id_from_discovery_in_setup_retry( async def test_unique_id_from_discovery_in_setup_retry(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that we reload when in a setup retry state from discovery.""" """Test that we reload when in a setup retry state from discovery."""
hass.config.components.add("comp") hass.config.components.add("comp")
@ -1851,7 +1916,7 @@ async def test_unique_id_from_discovery_in_setup_retry(
async def test_unique_id_not_update_existing_entry( async def test_unique_id_not_update_existing_entry(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that we do not update an entry if existing entry has the data.""" """Test that we do not update an entry if existing entry has the data."""
hass.config.components.add("comp") hass.config.components.add("comp")
@ -1895,7 +1960,9 @@ async def test_unique_id_not_update_existing_entry(
assert len(async_reload.mock_calls) == 0 assert len(async_reload.mock_calls) == 0
async def test_unique_id_in_progress(hass: HomeAssistant, manager) -> None: async def test_unique_id_in_progress(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we abort if there is already a flow in progress with same unique id.""" """Test that we abort if there is already a flow in progress with same unique id."""
mock_integration(hass, MockModule("comp")) mock_integration(hass, MockModule("comp"))
mock_entity_platform(hass, "config_flow.comp", None) mock_entity_platform(hass, "config_flow.comp", None)
@ -1926,7 +1993,9 @@ async def test_unique_id_in_progress(hass: HomeAssistant, manager) -> None:
assert result2["reason"] == "already_in_progress" assert result2["reason"] == "already_in_progress"
async def test_finish_flow_aborts_progress(hass: HomeAssistant, manager) -> None: async def test_finish_flow_aborts_progress(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that when finishing a flow, we abort other flows in progress with unique ID.""" """Test that when finishing a flow, we abort other flows in progress with unique ID."""
mock_integration( mock_integration(
hass, hass,
@ -1965,7 +2034,9 @@ async def test_finish_flow_aborts_progress(hass: HomeAssistant, manager) -> None
assert len(hass.config_entries.flow.async_progress()) == 0 assert len(hass.config_entries.flow.async_progress()) == 0
async def test_unique_id_ignore(hass: HomeAssistant, manager) -> None: async def test_unique_id_ignore(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we can ignore flows that are in progress and have a unique ID.""" """Test that we can ignore flows that are in progress and have a unique ID."""
async_setup_entry = AsyncMock(return_value=False) async_setup_entry = AsyncMock(return_value=False)
mock_integration(hass, MockModule("comp", async_setup_entry=async_setup_entry)) mock_integration(hass, MockModule("comp", async_setup_entry=async_setup_entry))
@ -2008,7 +2079,9 @@ async def test_unique_id_ignore(hass: HomeAssistant, manager) -> None:
assert entry.title == "Ignored Title" assert entry.title == "Ignored Title"
async def test_manual_add_overrides_ignored_entry(hass: HomeAssistant, manager) -> None: async def test_manual_add_overrides_ignored_entry(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we can ignore manually add entry, overriding ignored entry.""" """Test that we can ignore manually add entry, overriding ignored entry."""
hass.config.components.add("comp") hass.config.components.add("comp")
entry = MockConfigEntry( entry = MockConfigEntry(
@ -2054,7 +2127,7 @@ async def test_manual_add_overrides_ignored_entry(hass: HomeAssistant, manager)
async def test_manual_add_overrides_ignored_entry_singleton( async def test_manual_add_overrides_ignored_entry_singleton(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that we can ignore manually add entry, overriding ignored entry.""" """Test that we can ignore manually add entry, overriding ignored entry."""
hass.config.components.add("comp") hass.config.components.add("comp")
@ -2095,7 +2168,7 @@ async def test_manual_add_overrides_ignored_entry_singleton(
async def test__async_current_entries_does_not_skip_ignore_non_user( async def test__async_current_entries_does_not_skip_ignore_non_user(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that _async_current_entries does not skip ignore by default for non user step.""" """Test that _async_current_entries does not skip ignore by default for non user step."""
hass.config.components.add("comp") hass.config.components.add("comp")
@ -2132,7 +2205,7 @@ async def test__async_current_entries_does_not_skip_ignore_non_user(
async def test__async_current_entries_explicit_skip_ignore( async def test__async_current_entries_explicit_skip_ignore(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that _async_current_entries can explicitly include ignore.""" """Test that _async_current_entries can explicitly include ignore."""
hass.config.components.add("comp") hass.config.components.add("comp")
@ -2173,7 +2246,7 @@ async def test__async_current_entries_explicit_skip_ignore(
async def test__async_current_entries_explicit_include_ignore( async def test__async_current_entries_explicit_include_ignore(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that _async_current_entries can explicitly include ignore.""" """Test that _async_current_entries can explicitly include ignore."""
hass.config.components.add("comp") hass.config.components.add("comp")
@ -2209,7 +2282,9 @@ async def test__async_current_entries_explicit_include_ignore(
assert len(mock_setup_entry.mock_calls) == 0 assert len(mock_setup_entry.mock_calls) == 0
async def test_unignore_step_form(hass: HomeAssistant, manager) -> None: async def test_unignore_step_form(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we can ignore flows that are in progress and have a unique ID, then rediscover them.""" """Test that we can ignore flows that are in progress and have a unique ID, then rediscover them."""
async_setup_entry = AsyncMock(return_value=True) async_setup_entry = AsyncMock(return_value=True)
mock_integration(hass, MockModule("comp", async_setup_entry=async_setup_entry)) mock_integration(hass, MockModule("comp", async_setup_entry=async_setup_entry))
@ -2254,7 +2329,9 @@ async def test_unignore_step_form(hass: HomeAssistant, manager) -> None:
assert len(hass.config_entries.async_entries("comp")) == 0 assert len(hass.config_entries.async_entries("comp")) == 0
async def test_unignore_create_entry(hass: HomeAssistant, manager) -> None: async def test_unignore_create_entry(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that we can ignore flows that are in progress and have a unique ID, then rediscover them.""" """Test that we can ignore flows that are in progress and have a unique ID, then rediscover them."""
async_setup_entry = AsyncMock(return_value=True) async_setup_entry = AsyncMock(return_value=True)
mock_integration(hass, MockModule("comp", async_setup_entry=async_setup_entry)) mock_integration(hass, MockModule("comp", async_setup_entry=async_setup_entry))
@ -2302,7 +2379,9 @@ async def test_unignore_create_entry(hass: HomeAssistant, manager) -> None:
assert len(hass.config_entries.flow.async_progress_by_handler("comp")) == 0 assert len(hass.config_entries.flow.async_progress_by_handler("comp")) == 0
async def test_unignore_default_impl(hass: HomeAssistant, manager) -> None: async def test_unignore_default_impl(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that resdicovery is a no-op by default.""" """Test that resdicovery is a no-op by default."""
async_setup_entry = AsyncMock(return_value=True) async_setup_entry = AsyncMock(return_value=True)
mock_integration(hass, MockModule("comp", async_setup_entry=async_setup_entry)) mock_integration(hass, MockModule("comp", async_setup_entry=async_setup_entry))
@ -2334,7 +2413,9 @@ async def test_unignore_default_impl(hass: HomeAssistant, manager) -> None:
assert len(hass.config_entries.flow.async_progress()) == 0 assert len(hass.config_entries.flow.async_progress()) == 0
async def test_partial_flows_hidden(hass: HomeAssistant, manager) -> None: async def test_partial_flows_hidden(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that flows that don't have a cur_step and haven't finished initing are hidden.""" """Test that flows that don't have a cur_step and haven't finished initing are hidden."""
async_setup_entry = AsyncMock(return_value=True) async_setup_entry = AsyncMock(return_value=True)
mock_integration(hass, MockModule("comp", async_setup_entry=async_setup_entry)) mock_integration(hass, MockModule("comp", async_setup_entry=async_setup_entry))
@ -2395,7 +2476,7 @@ async def test_partial_flows_hidden(hass: HomeAssistant, manager) -> None:
async def test_async_setup_init_entry(hass: HomeAssistant) -> None: async def test_async_setup_init_entry(hass: HomeAssistant) -> None:
"""Test a config entry being initialized during integration setup.""" """Test a config entry being initialized during integration setup."""
async def mock_async_setup(hass, config): async def mock_async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Mock setup.""" """Mock setup."""
hass.async_create_task( hass.async_create_task(
hass.config_entries.flow.async_init( hass.config_entries.flow.async_init(
@ -2576,7 +2657,9 @@ async def test_async_setup_update_entry(hass: HomeAssistant) -> None:
), ),
) )
async def test_flow_with_default_discovery( async def test_flow_with_default_discovery(
hass: HomeAssistant, manager, discovery_source hass: HomeAssistant,
manager: config_entries.ConfigEntries,
discovery_source: tuple[str, dict | BaseServiceInfo],
) -> None: ) -> None:
"""Test that finishing a default discovery flow removes the unique ID in the entry.""" """Test that finishing a default discovery flow removes the unique ID in the entry."""
mock_integration( mock_integration(
@ -2626,7 +2709,7 @@ async def test_flow_with_default_discovery(
async def test_flow_with_default_discovery_with_unique_id( async def test_flow_with_default_discovery_with_unique_id(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test discovery flow using the default discovery is ignored when unique ID is set.""" """Test discovery flow using the default discovery is ignored when unique ID is set."""
mock_integration(hass, MockModule("comp")) mock_integration(hass, MockModule("comp"))
@ -2656,7 +2739,7 @@ async def test_flow_with_default_discovery_with_unique_id(
async def test_default_discovery_abort_existing_entries( async def test_default_discovery_abort_existing_entries(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that a flow without discovery implementation aborts when a config entry exists.""" """Test that a flow without discovery implementation aborts when a config entry exists."""
hass.config.components.add("comp") hass.config.components.add("comp")
@ -2679,7 +2762,9 @@ async def test_default_discovery_abort_existing_entries(
assert result["reason"] == "already_configured" assert result["reason"] == "already_configured"
async def test_default_discovery_in_progress(hass: HomeAssistant, manager) -> None: async def test_default_discovery_in_progress(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test that a flow using default discovery can only be triggered once.""" """Test that a flow using default discovery can only be triggered once."""
mock_integration(hass, MockModule("comp")) mock_integration(hass, MockModule("comp"))
mock_entity_platform(hass, "config_flow.comp", None) mock_entity_platform(hass, "config_flow.comp", None)
@ -2715,7 +2800,7 @@ async def test_default_discovery_in_progress(hass: HomeAssistant, manager) -> No
async def test_default_discovery_abort_on_new_unique_flow( async def test_default_discovery_abort_on_new_unique_flow(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that a flow using default discovery is aborted when a second flow with unique ID is created.""" """Test that a flow using default discovery is aborted when a second flow with unique ID is created."""
mock_integration(hass, MockModule("comp")) mock_integration(hass, MockModule("comp"))
@ -2754,7 +2839,7 @@ async def test_default_discovery_abort_on_new_unique_flow(
async def test_default_discovery_abort_on_user_flow_complete( async def test_default_discovery_abort_on_user_flow_complete(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that a flow using default discovery is aborted when a second flow completes.""" """Test that a flow using default discovery is aborted when a second flow completes."""
mock_integration(hass, MockModule("comp")) mock_integration(hass, MockModule("comp"))
@ -2804,7 +2889,9 @@ async def test_default_discovery_abort_on_user_flow_complete(
assert len(flows) == 0 assert len(flows) == 0
async def test_flow_same_device_multiple_sources(hass: HomeAssistant, manager) -> None: async def test_flow_same_device_multiple_sources(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test discovery of the same devices from multiple discovery sources.""" """Test discovery of the same devices from multiple discovery sources."""
mock_integration( mock_integration(
hass, hass,
@ -2872,7 +2959,9 @@ async def test_flow_same_device_multiple_sources(hass: HomeAssistant, manager) -
assert entry.unique_id == "thisid" assert entry.unique_id == "thisid"
async def test_updating_entry_with_and_without_changes(manager) -> None: async def test_updating_entry_with_and_without_changes(
manager: config_entries.ConfigEntries,
) -> None:
"""Test that we can update an entry data.""" """Test that we can update an entry data."""
entry = MockConfigEntry( entry = MockConfigEntry(
domain="test", domain="test",
@ -2900,7 +2989,7 @@ async def test_updating_entry_with_and_without_changes(manager) -> None:
async def test_entry_reload_calls_on_unload_listeners( async def test_entry_reload_calls_on_unload_listeners(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test reload calls the on unload listeners.""" """Test reload calls the on unload listeners."""
entry = MockConfigEntry(domain="comp", state=config_entries.ConfigEntryState.LOADED) entry = MockConfigEntry(domain="comp", state=config_entries.ConfigEntryState.LOADED)
@ -3239,7 +3328,10 @@ async def test_setup_retrying_during_shutdown(hass: HomeAssistant) -> None:
], ],
) )
async def test__async_abort_entries_match( async def test__async_abort_entries_match(
hass: HomeAssistant, manager, matchers, reason hass: HomeAssistant,
manager: config_entries.ConfigEntries,
matchers: dict[str, str],
reason: str,
) -> None: ) -> None:
"""Test aborting if matching config entries exist.""" """Test aborting if matching config entries exist."""
MockConfigEntry( MockConfigEntry(
@ -3336,7 +3428,9 @@ async def test_deprecated_disabled_by_str_ctor(
async def test_deprecated_disabled_by_str_set( async def test_deprecated_disabled_by_str_set(
hass: HomeAssistant, manager, caplog: pytest.LogCaptureFixture hass: HomeAssistant,
manager: config_entries.ConfigEntries,
caplog: pytest.LogCaptureFixture,
) -> None: ) -> None:
"""Test deprecated str set disabled_by enumizes and logs a warning.""" """Test deprecated str set disabled_by enumizes and logs a warning."""
entry = MockConfigEntry() entry = MockConfigEntry()
@ -3348,7 +3442,9 @@ async def test_deprecated_disabled_by_str_set(
assert " str for config entry disabled_by. This is deprecated " in caplog.text assert " str for config entry disabled_by. This is deprecated " in caplog.text
async def test_entry_reload_concurrency(hass: HomeAssistant, manager) -> None: async def test_entry_reload_concurrency(
hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None:
"""Test multiple reload calls do not cause a reload race.""" """Test multiple reload calls do not cause a reload race."""
entry = MockConfigEntry(domain="comp", state=config_entries.ConfigEntryState.LOADED) entry = MockConfigEntry(domain="comp", state=config_entries.ConfigEntryState.LOADED)
entry.add_to_hass(hass) entry.add_to_hass(hass)
@ -3457,7 +3553,7 @@ async def test_unique_id_update_while_setup_in_progress(
async def test_disallow_entry_reload_with_setup_in_progresss( async def test_disallow_entry_reload_with_setup_in_progresss(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test we do not allow reload while the config entry is still setting up.""" """Test we do not allow reload while the config entry is still setting up."""
entry = MockConfigEntry( entry = MockConfigEntry(
@ -3638,7 +3734,7 @@ async def test_options_flow_options_not_mutated() -> None:
async def test_initializing_flows_canceled_on_shutdown( async def test_initializing_flows_canceled_on_shutdown(
hass: HomeAssistant, manager hass: HomeAssistant, manager: config_entries.ConfigEntries
) -> None: ) -> None:
"""Test that initializing flows are canceled on shutdown.""" """Test that initializing flows are canceled on shutdown."""