From c4e5b59326b38f21396ec04c07c0002f70fd5d44 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 28 Nov 2024 13:41:30 +0100 Subject: [PATCH] Fix more flaky translation checks (#131824) --- tests/components/stt/test_init.py | 4 ++++ tests/components/tts/test_init.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/components/stt/test_init.py b/tests/components/stt/test_init.py index 92225123995..3d5daab2bec 100644 --- a/tests/components/stt/test_init.py +++ b/tests/components/stt/test_init.py @@ -34,6 +34,7 @@ from tests.common import ( mock_integration, mock_platform, mock_restore_cache, + reset_translation_cache, ) from tests.typing import ClientSessionGenerator, WebSocketGenerator @@ -518,6 +519,9 @@ async def test_default_engine_prefer_cloud_entity( assert provider_engine.name == "test" assert async_default_engine(hass) == "stt.cloud_stt_entity" + # Reset the `cloud` translations cache to avoid flaky translation checks + reset_translation_cache(hass, ["cloud"]) + async def test_get_engine_legacy( hass: HomeAssistant, tmp_path: Path, mock_provider: MockSTTProvider diff --git a/tests/components/tts/test_init.py b/tests/components/tts/test_init.py index 9d8dbf3ef94..0b01a24720d 100644 --- a/tests/components/tts/test_init.py +++ b/tests/components/tts/test_init.py @@ -1990,5 +1990,5 @@ async def test_default_engine_prefer_cloud_entity( assert provider_engine == "test" assert tts.async_default_engine(hass) == "tts.cloud_tts_entity" - # Reset the `cloud` translations cache + # Reset the `cloud` translations cache to avoid flaky translation checks reset_translation_cache(hass, ["cloud"])