Make sure ACK's are processed before mqtt tests are teared down (#120329)

This commit is contained in:
Jan Bouwhuis 2024-06-24 15:16:09 +02:00 committed by GitHub
parent 57cdd33537
commit 389b9d1ad6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 1 deletions

View File

@ -1173,6 +1173,8 @@ async def test_cleanup_triggers_and_restoring_state(
state = hass.states.get("binary_sensor.test2")
assert state.state == state2
await hass.async_block_till_done(wait_background_tasks=True)
@pytest.mark.parametrize(
"hass_config",

View File

@ -240,6 +240,8 @@ async def test_device_tracker_discovery_update(
# Entity was not updated as the state was not changed
assert state.last_updated == datetime(2023, 8, 22, 19, 16, tzinfo=UTC)
await hass.async_block_till_done(wait_background_tasks=True)
async def test_cleanup_device_tracker(
hass: HomeAssistant,

View File

@ -222,6 +222,8 @@ async def test_setting_event_value_via_mqtt_json_message_and_default_current_sta
assert state.attributes.get("val") == "valcontent"
assert state.attributes.get("par") == "parcontent"
await hass.async_block_till_done(wait_background_tasks=True)
@pytest.mark.parametrize("hass_config", [DEFAULT_CONFIG])
async def test_availability_when_connection_lost(

View File

@ -335,7 +335,7 @@ async def test_default_entity_and_device_name(
# Assert that no issues ware registered
assert len(events) == 0
await hass.async_block_till_done()
await hass.async_block_till_done(wait_background_tasks=True)
# Assert that no issues ware registered
assert len(events) == 0