1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Simplify waiting for recorder in tests (#70647)

This commit is contained in:
Erik Montnemery
2022-04-25 12:04:47 +02:00
committed by GitHub
parent a8a7359c6f
commit 28ebab9c5a
38 changed files with 207 additions and 231 deletions

View File

@@ -18,7 +18,7 @@ from homeassistant.core import State
from homeassistant.setup import async_setup_component
from tests.common import async_mock_service
from tests.components.recorder.common import async_wait_recording_done_without_instance
from tests.components.recorder.common import async_wait_recording_done
@pytest.fixture
@@ -44,7 +44,7 @@ async def test_exclude_attributes(hass, recorder_mock, calls):
await hass.async_block_till_done()
assert len(calls) == 1
assert ["hello.world"] == calls[0].data.get(ATTR_ENTITY_ID)
await async_wait_recording_done_without_instance(hass)
await async_wait_recording_done(hass)
def _fetch_states() -> list[State]:
with session_scope(hass=hass) as session: