Fix lingering mqtt unload entry test (#124392)

pull/124398/head
Jan Bouwhuis 2024-08-22 11:03:35 +02:00 committed by GitHub
parent 0c8ed18ca5
commit b541d214ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -18,7 +18,7 @@ from homeassistant.setup import async_setup_component
from .test_common import help_test_unload_config_entry from .test_common import help_test_unload_config_entry
from tests.common import async_fire_mqtt_message, async_get_device_automations from tests.common import async_fire_mqtt_message, async_get_device_automations
from tests.typing import MqttMockHAClient, MqttMockHAClientGenerator, WebSocketGenerator from tests.typing import MqttMockHAClientGenerator, WebSocketGenerator
@pytest.fixture(autouse=True, name="stub_blueprint_populate") @pytest.fixture(autouse=True, name="stub_blueprint_populate")
@ -1672,11 +1672,11 @@ async def test_trigger_debug_info(
assert debug_info_data["triggers"][0]["discovery_data"]["payload"] == config2 assert debug_info_data["triggers"][0]["discovery_data"]["payload"] == config2
@pytest.mark.usefixtures("mqtt_mock")
async def test_unload_entry( async def test_unload_entry(
hass: HomeAssistant, hass: HomeAssistant,
service_calls: list[ServiceCall], service_calls: list[ServiceCall],
device_registry: dr.DeviceRegistry, device_registry: dr.DeviceRegistry,
mqtt_mock: MqttMockHAClient,
) -> None: ) -> None:
"""Test unloading the MQTT entry.""" """Test unloading the MQTT entry."""
@ -1738,3 +1738,4 @@ async def test_unload_entry(
async_fire_mqtt_message(hass, "foobar/triggers/button1", "short_press") async_fire_mqtt_message(hass, "foobar/triggers/button1", "short_press")
await hass.async_block_till_done() await hass.async_block_till_done()
assert len(service_calls) == 2 assert len(service_calls) == 2
await hass.async_block_till_done(wait_background_tasks=True)