From fb73768164a0d885204838a8ec14a181d81c9431 Mon Sep 17 00:00:00 2001 From: ollo69 <60491700+ollo69@users.noreply.github.com> Date: Wed, 17 Feb 2021 10:43:12 +0100 Subject: [PATCH] Fix Tuya Option Flow tests (#46651) --- tests/components/tuya/test_config_flow.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/components/tuya/test_config_flow.py b/tests/components/tuya/test_config_flow.py index 012886fe3b8..ede6e5ac1db 100644 --- a/tests/components/tuya/test_config_flow.py +++ b/tests/components/tuya/test_config_flow.py @@ -181,6 +181,15 @@ async def test_options_flow(hass): ) config_entry.add_to_hass(hass) + # Set up the integration to make sure the config flow module is loaded. + assert await hass.config_entries.async_setup(config_entry.entry_id) + await hass.async_block_till_done() + + # Unload the integration to prepare for the test. + with patch("homeassistant.components.tuya.async_unload_entry", return_value=True): + assert await hass.config_entries.async_unload(config_entry.entry_id) + await hass.async_block_till_done() + # Test check for integration not loaded result = await hass.config_entries.options.async_init(config_entry.entry_id) assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT