From 53b6223459293a64cd07fdc99166ab84466a5013 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Fri, 27 Feb 2026 20:35:50 +0100 Subject: [PATCH] Mock async_setup_entry in emulated_roku config flow tests (#164368) --- tests/components/emulated_roku/test_config_flow.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/components/emulated_roku/test_config_flow.py b/tests/components/emulated_roku/test_config_flow.py index 0b0efb83967..6de00908877 100644 --- a/tests/components/emulated_roku/test_config_flow.py +++ b/tests/components/emulated_roku/test_config_flow.py @@ -1,5 +1,10 @@ """Tests for emulated_roku config flow.""" +from collections.abc import Generator +from unittest.mock import AsyncMock, patch + +import pytest + from homeassistant import config_entries from homeassistant.components.emulated_roku import config_flow from homeassistant.core import HomeAssistant @@ -8,6 +13,15 @@ from homeassistant.data_entry_flow import FlowResultType from tests.common import MockConfigEntry +@pytest.fixture(autouse=True) +def mock_setup_entry() -> Generator[AsyncMock]: + """Override async_setup_entry.""" + with patch( + "homeassistant.components.emulated_roku.async_setup_entry", return_value=True + ) as mock_setup: + yield mock_setup + + async def test_flow_works(hass: HomeAssistant) -> None: """Test that config flow works.""" result = await hass.config_entries.flow.async_init(