Reset the threading.local _hass object in tests (#101700)

This commit is contained in:
Erik Montnemery 2023-10-09 13:41:51 +02:00 committed by GitHub
parent f7292d5b00
commit 8a83e810b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -559,6 +559,9 @@ async def hass(
# Restore timezone, it is set when creating the hass object # Restore timezone, it is set when creating the hass object
dt_util.DEFAULT_TIME_ZONE = orig_tz dt_util.DEFAULT_TIME_ZONE = orig_tz
# Reset the _Hass threading.local object
ha._hass.__dict__.clear()
for ex in exceptions: for ex in exceptions:
if ( if (
request.module.__name__, request.module.__name__,