Use new setup_test_component_platform helper instead of test fixture for light platform (#114200)

This commit is contained in:
Jan-Philipp Benecke 2024-03-26 00:17:16 +01:00 committed by GitHub
parent 6bb4e7d62c
commit 9580adfde9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 96 additions and 173 deletions

View file

@ -18,19 +18,22 @@ from homeassistant.setup import async_setup_component
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
from tests.common import (
async_mock_service,
mock_restore_cache,
setup_test_component_platform,
)
from tests.components.light.common import MockLight
@pytest.fixture(autouse=True)
def entities(
hass: HomeAssistant,
setup_light_platform: SetupLightPlatformCallable,
mock_light_entities: list[MockLight],
) -> list[MockLight]:
"""Initialize the test light."""
entities = mock_light_entities[0:2]
setup_light_platform(hass, entities)
setup_test_component_platform(hass, light.DOMAIN, entities)
return entities