From 8a83e810b8b8b2f0ce090c19e4b582de7c968e19 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 9 Oct 2023 13:41:51 +0200 Subject: [PATCH] Reset the threading.local _hass object in tests (#101700) --- tests/conftest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 015cae17205..c04b90d349e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -559,6 +559,9 @@ async def hass( # Restore timezone, it is set when creating the hass object dt_util.DEFAULT_TIME_ZONE = orig_tz + # Reset the _Hass threading.local object + ha._hass.__dict__.clear() + for ex in exceptions: if ( request.module.__name__,