From 88c3be4ecfb228a414636439d186751538328b7a Mon Sep 17 00:00:00 2001 From: G Johansson Date: Thu, 16 Jan 2025 23:26:50 +0100 Subject: [PATCH] Ensure entity platform in light tests (#135787) --- tests/components/light/test_init.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/components/light/test_init.py b/tests/components/light/test_init.py index c947de5923b..6d0337f37a5 100644 --- a/tests/components/light/test_init.py +++ b/tests/components/light/test_init.py @@ -2626,7 +2626,9 @@ def test_filter_supported_color_modes() -> None: assert light.filter_supported_color_modes(supported) == {light.ColorMode.BRIGHTNESS} -def test_deprecated_supported_features_ints(caplog: pytest.LogCaptureFixture) -> None: +def test_deprecated_supported_features_ints( + hass: HomeAssistant, caplog: pytest.LogCaptureFixture +) -> None: """Test deprecated supported features ints.""" class MockLightEntityEntity(light.LightEntity): @@ -2636,6 +2638,8 @@ def test_deprecated_supported_features_ints(caplog: pytest.LogCaptureFixture) -> return 1 entity = MockLightEntityEntity() + entity.hass = hass + entity.platform = MockEntityPlatform(hass, domain="test", platform_name="test") assert entity.supported_features_compat is light.LightEntityFeature(1) assert "MockLightEntityEntity" in caplog.text assert "is using deprecated supported features values" in caplog.text