From c9dc3a61af14259485006e8d6b3826ffa62a69ae Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Fri, 26 Nov 2021 00:14:15 +0100 Subject: [PATCH] Fix slow config_flow test in devolo Home Network (#60364) --- .../devolo_home_network/test_config_flow.py | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/tests/components/devolo_home_network/test_config_flow.py b/tests/components/devolo_home_network/test_config_flow.py index 0be07be9a00..1af3c39bca2 100644 --- a/tests/components/devolo_home_network/test_config_flow.py +++ b/tests/components/devolo_home_network/test_config_flow.py @@ -102,11 +102,15 @@ async def test_zeroconf(hass: HomeAssistant): == DISCOVERY_INFO["hostname"].split(".", maxsplit=1)[0] ) - result2 = await hass.config_entries.flow.async_configure( - result["flow_id"], - {}, - ) - await hass.async_block_till_done() + with patch( + "homeassistant.components.devolo_home_network.async_setup_entry", + return_value=True, + ): + result2 = await hass.config_entries.flow.async_configure( + result["flow_id"], + {}, + ) + await hass.async_block_till_done() assert result2["title"] == "test" assert result2["data"] == { @@ -131,13 +135,17 @@ async def test_abort_if_configued(hass: HomeAssistant): result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} ) - await hass.config_entries.flow.async_configure( - result["flow_id"], - { - CONF_IP_ADDRESS: IP, - }, - ) - await hass.async_block_till_done() + with patch( + "homeassistant.components.devolo_home_network.async_setup_entry", + return_value=True, + ): + await hass.config_entries.flow.async_configure( + result["flow_id"], + { + CONF_IP_ADDRESS: IP, + }, + ) + await hass.async_block_till_done() # Abort on concurrent user flow result = await hass.config_entries.flow.async_init(