mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Fix mqtt discovery subscribe unsubscribe test with one less task (#110914)
This test currently relies on event loop overhead and since #110899 will remove another task in the config entry init flow, it needs another async_block_till_done. In the future it should be refactored to have better synchronization without having to rely on iterations of the event loop.
This commit is contained in:
parent
795d90eb1b
commit
b35d7a348b
@ -1532,6 +1532,7 @@ async def test_mqtt_integration_discovery_subscribe_unsubscribe(
|
||||
await asyncio.sleep(0)
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done()
|
||||
mqtt_client_mock.unsubscribe.assert_called_once_with(["comp/discovery/#"])
|
||||
mqtt_client_mock.unsubscribe.reset_mock()
|
||||
|
||||
@ -1539,6 +1540,7 @@ async def test_mqtt_integration_discovery_subscribe_unsubscribe(
|
||||
await asyncio.sleep(0)
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done()
|
||||
assert not mqtt_client_mock.unsubscribe.called
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user