From c300e1e376173fcd4f9774186798545e86ff10d2 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 7 May 2025 17:13:55 +0200 Subject: [PATCH] Reset more caches in --- tests/conftest.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 43d7694d9c1..15c70485fc5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -59,6 +59,7 @@ from homeassistant import components, core as ha, loader, runner from homeassistant.auth.const import GROUP_ID_ADMIN, GROUP_ID_READ_ONLY from homeassistant.auth.models import Credentials from homeassistant.auth.providers import homeassistant +from homeassistant.components import api, mobile_app, websocket_api from homeassistant.components.device_tracker.legacy import Device # pylint: disable-next=hass-component-root-import @@ -546,7 +547,13 @@ def reset_globals() -> Generator[None]: # Reset the aiohttp cache web_app._cached_build_middleware.cache_clear() - # Reset the template cache + # Reset the recorder helper get_instance cache + recorder_helper.get_instance.cache_clear() + + # Reset the template caches + api._cached_template.cache_clear() + mobile_app.webhook._cached_template.cache_clear() + websocket_api.commands._cached_template.cache_clear() template.CACHED_TEMPLATE_LRU.clear() template.CACHED_TEMPLATE_NO_COLLECT_LRU.clear() template._domain_states.cache_clear()