Reset helpers.frame._REPORTED_INTEGRATIONS in between tests (#139924)
* Reset helpers.frame._REPORTED_INTEGRATIONS in between tests * Rename * Apply suggestions from code review Co-authored-by: Erik Montnemery <erik@montnemery.com> --------- Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
@@ -430,11 +430,16 @@ def verify_cleanup(
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def reset_hass_threading_local_object() -> Generator[None]:
|
||||
"""Reset the _Hass threading.local object for every test case."""
|
||||
def reset_globals() -> Generator[None]:
|
||||
"""Reset global objects for every test case."""
|
||||
yield
|
||||
|
||||
# Reset the _Hass threading.local object
|
||||
ha._hass.__dict__.clear()
|
||||
|
||||
# Reset the frame helper globals
|
||||
frame.async_setup(None)
|
||||
frame._REPORTED_INTEGRATIONS.clear()
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True, scope="session")
|
||||
|
||||
Reference in New Issue
Block a user