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)])