Fix lingering task in entity_platform test (#88957)
* Fix lingering task in entity_platform test * Speed up the test
This commit is contained in:
parent
ed3cdd8fb9
commit
6febe00516
1 changed files with 4 additions and 1 deletions
|
@ -233,7 +233,7 @@ async def test_platform_error_slow_setup(
|
|||
|
||||
async def setup_platform(*args):
|
||||
called.append(1)
|
||||
await asyncio.sleep(1)
|
||||
await asyncio.sleep(0.1)
|
||||
|
||||
platform = MockPlatform(async_setup_platform=setup_platform)
|
||||
component = EntityComponent(_LOGGER, DOMAIN, hass)
|
||||
|
@ -244,6 +244,9 @@ async def test_platform_error_slow_setup(
|
|||
assert "test_domain.test_platform" not in hass.config.components
|
||||
assert "test_platform is taking longer than 0 seconds" in caplog.text
|
||||
|
||||
# Cleanup lingering (setup_platform) task after test is done
|
||||
await asyncio.sleep(0.1)
|
||||
|
||||
|
||||
async def test_updated_state_used_for_entity_id(hass: HomeAssistant) -> None:
|
||||
"""Test that first update results used for entity ID generation."""
|
||||
|
|
Loading…
Add table
Reference in a new issue