Reset the threading.local _hass object every time (#101728)
* Reset the threading.local _hass object every time * Remove reset from hass fixturepull/101754/head
parent
f78199df9f
commit
915f5bf84e
|
@ -376,6 +376,13 @@ def verify_cleanup(
|
|||
)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def reset_hass_threading_local_object() -> Generator[None, None, None]:
|
||||
"""Reset the _Hass threading.local object for every test case."""
|
||||
yield
|
||||
ha._hass.__dict__.clear()
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def bcrypt_cost() -> Generator[None, None, None]:
|
||||
"""Run with reduced rounds during tests, to speed up uses."""
|
||||
|
@ -559,9 +566,6 @@ 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__,
|
||||
|
|
Loading…
Reference in New Issue