From edc19328c09a041bcb6e9ae7b9ed2b15315feea5 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Fri, 22 Mar 2024 17:48:53 +0100 Subject: [PATCH] Remove deprecated `hass.components` from scene tests (#114014) --- tests/components/scene/test_init.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/components/scene/test_init.py b/tests/components/scene/test_init.py index 660be91dca2..ad8e478105e 100644 --- a/tests/components/scene/test_init.py +++ b/tests/components/scene/test_init.py @@ -19,14 +19,19 @@ from homeassistant.util import dt as dt_util from homeassistant.util.yaml import loader as yaml_loader from tests.common import async_mock_service, mock_restore_cache +from tests.components.light.common import MockLight, SetupLightPlatformCallable @pytest.fixture(autouse=True) -def entities(hass): +def entities( + hass: HomeAssistant, + setup_light_platform: SetupLightPlatformCallable, + mock_light_entities: list[MockLight], +) -> list[MockLight]: """Initialize the test light.""" - platform = getattr(hass.components, "test.light") - platform.init() - return platform.ENTITIES[0:2] + entities = mock_light_entities[0:2] + setup_light_platform(hass, entities) + return entities async def test_config_yaml_alias_anchor(