1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-26 14:08:21 +00:00

Remove workaround for flaky translation tests (#131628)

This commit is contained in:
epenet
2024-11-27 15:37:36 +01:00
committed by GitHub
parent a7db35c76c
commit d6f4a79b46
4 changed files with 28 additions and 5 deletions

View File

@@ -1192,7 +1192,12 @@ def mock_get_source_ip() -> Generator[_patch]:
@pytest.fixture(autouse=True, scope="session")
def translations_once() -> Generator[_patch]:
"""Only load translations once per session."""
"""Only load translations once per session.
Warning: having this as a session fixture can cause issues with tests that
create mock integrations, overriding the real integration translations
with empty ones. Translations should be reset after such tests (see #131628)
"""
cache = _TranslationsCacheData({}, {})
patcher = patch(
"homeassistant.helpers.translation._TranslationsCacheData",