Fix lingering task in entity_platform test ()

* Fix lingering task in entity_platform test

* Speed up the test
This commit is contained in:
epenet 2023-03-01 10:49:13 +01:00 committed by GitHub
parent ed3cdd8fb9
commit 6febe00516
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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."""