Skip to content

Commit

Permalink
skip reload
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouwh committed Jun 14, 2022
1 parent ee6e1e2 commit 1753446
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/components/mqtt/test_config_flow.py
Expand Up @@ -63,6 +63,20 @@ def _unsubscribe(topic):
yield mock_client()


@pytest.fixture
def mqtt_skip_reload(tmp_path):
"""Mock and empty configuration.yaml."""

async def async_mock_reload(hass):
pass

with patch(
"homeassistant.components.mqtt.async_reload_manual_mqtt_items",
side_effect=async_mock_reload,
) as skip_reload:
yield skip_reload


@pytest.fixture
def mock_try_connection_time_out():
"""Mock the try connection method with a time out."""
Expand Down Expand Up @@ -145,7 +159,11 @@ async def test_manual_config_starts_discovery_flow(


async def test_manual_config_set(
hass, mock_try_connection, mock_finish_setup, mqtt_client_mock
hass,
mock_try_connection,
mock_finish_setup,
mqtt_client_mock,
mqtt_skip_reload,
):
"""Test manual config does not create an entry, and entry can be setup late."""
# MQTT config present in yaml config
Expand Down

0 comments on commit 1753446

Please sign in to comment.