From 48ab74eedfb9e28a62ef2cf86b0c4520d56e7581 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 15 May 2023 11:15:19 +0200 Subject: [PATCH] Add missing mock in wiffi tests (#93083) --- tests/components/wiffi/conftest.py | 14 ++++++++++++++ tests/components/wiffi/test_config_flow.py | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 tests/components/wiffi/conftest.py diff --git a/tests/components/wiffi/conftest.py b/tests/components/wiffi/conftest.py new file mode 100644 index 00000000000..bceded737c6 --- /dev/null +++ b/tests/components/wiffi/conftest.py @@ -0,0 +1,14 @@ +"""Configuration for Wiffi tests.""" +from collections.abc import Generator +from unittest.mock import AsyncMock, patch + +import pytest + + +@pytest.fixture +def mock_setup_entry() -> Generator[AsyncMock, None, None]: + """Override async_setup_entry.""" + with patch( + "homeassistant.components.wiffi.async_setup_entry", return_value=True + ) as mock_setup_entry: + yield mock_setup_entry diff --git a/tests/components/wiffi/test_config_flow.py b/tests/components/wiffi/test_config_flow.py index 0c069180e89..bf0b072df8c 100644 --- a/tests/components/wiffi/test_config_flow.py +++ b/tests/components/wiffi/test_config_flow.py @@ -14,6 +14,8 @@ from tests.common import MockConfigEntry MOCK_CONFIG = {CONF_PORT: 8765} +pytestmark = pytest.mark.usefixtures("mock_setup_entry") + @pytest.fixture(name="dummy_tcp_server") def mock_dummy_tcp_server():