From 8beddd2481c75b6fa3afabe3195fc7abd2d57e35 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 30 Apr 2025 16:04:12 +0200 Subject: [PATCH] Reset template state cache --- tests/conftest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 1822254ddd0..a0faca90528 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -96,6 +96,7 @@ from homeassistant.helpers import ( issue_registry as ir, label_registry as lr, recorder as recorder_helper, + template, translation as translation_helper, ) from homeassistant.helpers.dispatcher import async_dispatcher_send @@ -472,6 +473,10 @@ def reset_globals() -> Generator[None]: # Reset the aiohttp cache web_app._cached_build_middleware.cache_clear() + # Reset the template cache + template.CACHED_TEMPLATE_LRU.clear() + template.CACHED_TEMPLATE_NO_COLLECT_LRU.clear() + # Reset patch_json if patch_json.mock_objects: obj = patch_json.mock_objects.pop()