diff --git a/tests/components/freedompro/conftest.py b/tests/components/freedompro/conftest.py index bc3d7311058..80e13edb803 100644 --- a/tests/components/freedompro/conftest.py +++ b/tests/components/freedompro/conftest.py @@ -1,9 +1,10 @@ """Fixtures for Freedompro integration tests.""" from __future__ import annotations +from collections.abc import Generator from copy import deepcopy from typing import Any -from unittest.mock import patch +from unittest.mock import AsyncMock, patch import pytest @@ -14,6 +15,15 @@ from .const import DEVICES, DEVICES_STATE from tests.common import MockConfigEntry +@pytest.fixture +def mock_setup_entry() -> Generator[AsyncMock, None, None]: + """Override async_setup_entry.""" + with patch( + "homeassistant.components.freedompro.async_setup_entry", return_value=True + ) as mock_setup_entry: + yield mock_setup_entry + + @pytest.fixture(autouse=True) def mock_freedompro(): """Mock freedompro get_list and get_states.""" diff --git a/tests/components/freedompro/test_config_flow.py b/tests/components/freedompro/test_config_flow.py index 6fee3694ec7..dc55ba037ba 100644 --- a/tests/components/freedompro/test_config_flow.py +++ b/tests/components/freedompro/test_config_flow.py @@ -1,6 +1,8 @@ """Define tests for the Freedompro config flow.""" from unittest.mock import patch +import pytest + from homeassistant import data_entry_flow from homeassistant.components.freedompro.const import DOMAIN from homeassistant.config_entries import SOURCE_USER @@ -13,6 +15,8 @@ VALID_CONFIG = { CONF_API_KEY: "ksdjfgslkjdfksjdfksjgfksjd", } +pytestmark = pytest.mark.usefixtures("mock_setup_entry") + async def test_show_form(hass: HomeAssistant) -> None: """Test that the form is served with no input."""