Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset the threading.local _hass object every time #101728

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down