From feb65c7e9f7569aa75dd365cab72bee03bbd223c Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Sun, 26 Jan 2025 17:42:10 +0100 Subject: [PATCH] Fix optional argument in deconz test type definition (#136411) --- tests/components/deconz/conftest.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/components/deconz/conftest.py b/tests/components/deconz/conftest.py index fd3003b96ef..4a74a673ef8 100644 --- a/tests/components/deconz/conftest.py +++ b/tests/components/deconz/conftest.py @@ -19,9 +19,14 @@ from tests.common import MockConfigEntry from tests.components.light.conftest import mock_light_profiles # noqa: F401 from tests.test_util.aiohttp import AiohttpClientMocker -type ConfigEntryFactoryType = Callable[ - [MockConfigEntry], Coroutine[Any, Any, MockConfigEntry] -] + +class ConfigEntryFactoryType(Protocol): + """Fixture factory that can set up deCONZ config entry.""" + + async def __call__(self, entry: MockConfigEntry = ..., /) -> MockConfigEntry: + """Set up a deCONZ config entry.""" + + type WebsocketDataType = Callable[[dict[str, Any]], Coroutine[Any, Any, None]] type WebsocketStateType = Callable[[str], Coroutine[Any, Any, None]] @@ -203,10 +208,10 @@ async def fixture_config_entry_factory( config_entry: MockConfigEntry, mock_requests: Callable[[str], None], ) -> ConfigEntryFactoryType: - """Fixture factory that can set up UniFi network integration.""" + """Fixture factory that can set up deCONZ integration.""" async def __mock_setup_config_entry( - entry: MockConfigEntry = config_entry, + entry: MockConfigEntry = config_entry, / ) -> MockConfigEntry: entry.add_to_hass(hass) mock_requests(entry.data[CONF_HOST])