diff --git a/tests/components/conftest.py b/tests/components/conftest.py index ce2e67981da..58126224279 100644 --- a/tests/components/conftest.py +++ b/tests/components/conftest.py @@ -475,14 +475,14 @@ async def _ensure_translation_exists( ) -> None: """Raise if translation doesn't exist.""" full_key = f"component.{component}.{category}.{key}" - if full_key in ignore_translations: - ignore_translations[full_key] = "used" - return - translations = await async_get_translations(hass, "en", category, [component]) if full_key in translations: return + if full_key in ignore_translations: + ignore_translations[full_key] = "used" + return + key_parts = key.split(".") # Ignore step data translations if title or description exists if ( diff --git a/tests/components/gardena_bluetooth/snapshots/test_config_flow.ambr b/tests/components/gardena_bluetooth/snapshots/test_config_flow.ambr index 60e47fa44c5..6d521b1f2c8 100644 --- a/tests/components/gardena_bluetooth/snapshots/test_config_flow.ambr +++ b/tests/components/gardena_bluetooth/snapshots/test_config_flow.ambr @@ -84,7 +84,7 @@ 'type': , }) # --- -# name: test_failed_connect[component.gardena_bluetooth.config.abort.cannot_connect] +# name: test_failed_connect FlowResultSnapshot({ 'data_schema': list([ dict({ @@ -109,7 +109,7 @@ 'type': , }) # --- -# name: test_failed_connect[component.gardena_bluetooth.config.abort.cannot_connect].1 +# name: test_failed_connect.1 FlowResultSnapshot({ 'data_schema': None, 'description_placeholders': dict({ @@ -124,7 +124,7 @@ 'type': , }) # --- -# name: test_failed_connect[component.gardena_bluetooth.config.abort.cannot_connect].2 +# name: test_failed_connect.2 FlowResultSnapshot({ 'description_placeholders': dict({ 'error': 'something went wrong', diff --git a/tests/components/gardena_bluetooth/test_config_flow.py b/tests/components/gardena_bluetooth/test_config_flow.py index 41b880fd28e..3b4e9c242b3 100644 --- a/tests/components/gardena_bluetooth/test_config_flow.py +++ b/tests/components/gardena_bluetooth/test_config_flow.py @@ -50,10 +50,6 @@ async def test_user_selection( assert result == snapshot -@pytest.mark.parametrize( # Remove when translations fixed - "ignore_translations", - ["component.gardena_bluetooth.config.abort.cannot_connect"], -) async def test_failed_connect( hass: HomeAssistant, mock_client: Mock, diff --git a/tests/components/google/test_config_flow.py b/tests/components/google/test_config_flow.py index b58c48a398e..b7962921ffd 100644 --- a/tests/components/google/test_config_flow.py +++ b/tests/components/google/test_config_flow.py @@ -437,10 +437,6 @@ async def test_multiple_config_entries( assert len(entries) == 2 -@pytest.mark.parametrize( # Remove when translations fixed - "ignore_translations", - ["component.google.config.abort.missing_credentials"], -) async def test_missing_configuration( hass: HomeAssistant, ) -> None: diff --git a/tests/components/iotty/test_config_flow.py b/tests/components/iotty/test_config_flow.py index eb6ca89357a..83fa16ece56 100644 --- a/tests/components/iotty/test_config_flow.py +++ b/tests/components/iotty/test_config_flow.py @@ -45,10 +45,6 @@ def current_request_with_host(current_request: MagicMock) -> None: ) -@pytest.mark.parametrize( # Remove when translations fixed - "ignore_translations", - ["component.iotty.config.abort.missing_credentials"], -) async def test_config_flow_no_credentials(hass: HomeAssistant) -> None: """Test config flow base case with no credentials registered.""" result = await hass.config_entries.flow.async_init( diff --git a/tests/components/lifx/test_config_flow.py b/tests/components/lifx/test_config_flow.py index a37a4b412d8..d1a6920f84a 100644 --- a/tests/components/lifx/test_config_flow.py +++ b/tests/components/lifx/test_config_flow.py @@ -101,10 +101,6 @@ async def test_discovery(hass: HomeAssistant) -> None: assert result2["reason"] == "no_devices_found" -@pytest.mark.parametrize( # Remove when translations fixed - "ignore_translations", - ["component.lifx.config.abort.cannot_connect"], -) async def test_discovery_but_cannot_connect(hass: HomeAssistant) -> None: """Test we can discover the device but we cannot connect.""" with _patch_discovery(), _patch_config_flow_try_connect(no_device=True): diff --git a/tests/components/melcloud/test_config_flow.py b/tests/components/melcloud/test_config_flow.py index baaa7861c7b..3f6e42ac264 100644 --- a/tests/components/melcloud/test_config_flow.py +++ b/tests/components/melcloud/test_config_flow.py @@ -73,10 +73,6 @@ async def test_form(hass: HomeAssistant, mock_login, mock_get_devices) -> None: assert len(mock_setup_entry.mock_calls) == 1 -@pytest.mark.parametrize( # Remove when translations fixed - "ignore_translations", - ["component.melcloud.config.abort.cannot_connect"], -) @pytest.mark.parametrize( ("error", "reason"), [(ClientError(), "cannot_connect"), (TimeoutError(), "cannot_connect")], diff --git a/tests/components/teslemetry/test_config_flow.py b/tests/components/teslemetry/test_config_flow.py index 63e2a243480..aeee3a620d4 100644 --- a/tests/components/teslemetry/test_config_flow.py +++ b/tests/components/teslemetry/test_config_flow.py @@ -89,10 +89,6 @@ async def test_form_errors( assert result3["type"] is FlowResultType.CREATE_ENTRY -@pytest.mark.parametrize( # Remove when translations fixed - "ignore_translations", - ["component.teslemetry.config.abort.reauth_successful"], -) async def test_reauth(hass: HomeAssistant, mock_metadata: AsyncMock) -> None: """Test reauth flow.""" @@ -124,10 +120,6 @@ async def test_reauth(hass: HomeAssistant, mock_metadata: AsyncMock) -> None: assert mock_entry.data == CONFIG -@pytest.mark.parametrize( # Remove when translations fixed - "ignore_translations", - ["component.teslemetry.config.abort.reauth_successful"], -) @pytest.mark.parametrize( ("side_effect", "error"), [ diff --git a/tests/components/yolink/test_config_flow.py b/tests/components/yolink/test_config_flow.py index f981ed69bbe..1dd71368d73 100644 --- a/tests/components/yolink/test_config_flow.py +++ b/tests/components/yolink/test_config_flow.py @@ -22,10 +22,6 @@ CLIENT_SECRET = "6789" DOMAIN = "yolink" -@pytest.mark.parametrize( # Remove when translations fixed - "ignore_translations", - ["component.yolink.config.abort.missing_credentials"], -) async def test_abort_if_no_configuration(hass: HomeAssistant) -> None: """Check flow abort when no configuration.""" result = await hass.config_entries.flow.async_init(