From f3084165b10ef9eb9c4f1c321da26a200565c884 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 9 Mar 2023 19:04:51 +0100 Subject: [PATCH] Add missing mock in filesize config flow tests (#89441) --- tests/components/filesize/test_config_flow.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/components/filesize/test_config_flow.py b/tests/components/filesize/test_config_flow.py index 7010a3e9a4d..dd99aa2a723 100644 --- a/tests/components/filesize/test_config_flow.py +++ b/tests/components/filesize/test_config_flow.py @@ -1,6 +1,8 @@ """Tests for the Filesize config flow.""" from unittest.mock import patch +import pytest + from homeassistant.components.filesize.const import DOMAIN from homeassistant.config_entries import SOURCE_USER from homeassistant.const import CONF_FILE_PATH @@ -11,6 +13,8 @@ from . import TEST_DIR, TEST_FILE, TEST_FILE_NAME, async_create_file from tests.common import MockConfigEntry +pytestmark = pytest.mark.usefixtures("mock_setup_entry") + async def test_full_user_flow(hass: HomeAssistant) -> None: """Test the full user configuration flow.""" @@ -75,9 +79,6 @@ async def test_flow_fails_on_validation(hass: HomeAssistant) -> None: with patch( "homeassistant.components.filesize.config_flow.pathlib.Path", - ), patch( - "homeassistant.components.filesize.async_setup_entry", - return_value=True, ): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -91,9 +92,6 @@ async def test_flow_fails_on_validation(hass: HomeAssistant) -> None: hass.config.allowlist_external_dirs = {TEST_DIR} with patch( "homeassistant.components.filesize.config_flow.pathlib.Path", - ), patch( - "homeassistant.components.filesize.async_setup_entry", - return_value=True, ): result2 = await hass.config_entries.flow.async_configure( result["flow_id"],