Warn on undefined variables in templates (#48140)

* Warn on undefined variables in templates

* Add test

* fix tests

* fix tests
This commit is contained in:
Erik Montnemery 2021-03-20 15:16:04 +01:00 committed by GitHub
parent 863f75e65e
commit f8755a52c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 6 deletions

View file

@ -1277,8 +1277,7 @@ async def test_repeat_condition_warning(hass, caplog, condition):
hass.async_create_task(script_obj.async_run(context=Context()))
await asyncio.wait_for(hass.async_block_till_done(), 1)
assert len(caplog.record_tuples) == 1
assert caplog.record_tuples[0][1] == logging.WARNING
assert f"Error in '{condition}[0]' evaluation" in caplog.text
assert len(events) == count