From 6b5518b2bf8f610245920b9d043fde72b02b0f50 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 19 Mar 2024 10:44:04 -1000 Subject: [PATCH] Fix template sensor test relying on event bus debug logging (#113842) --- tests/components/template/test_sensor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/components/template/test_sensor.py b/tests/components/template/test_sensor.py index 462f1350656..8ce5596a446 100644 --- a/tests/components/template/test_sensor.py +++ b/tests/components/template/test_sensor.py @@ -476,7 +476,11 @@ async def test_invalid_attribute_template( await hass.async_block_till_done() await async_update_entity(hass, "sensor.invalid_template") assert "TemplateError" in caplog_setup_text - assert "test_attribute" in caplog.text + assert ( + "Template variable error: 'None' has no attribute 'attributes' when rendering" + in caplog.text + ) + assert hass.states.get("sensor.invalid_template").state == "startup" @pytest.mark.parametrize(("count", "domain"), [(1, sensor.DOMAIN)])