From 291f309c0ea99528229e39dfcacb3a9faaf62487 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 3 Jul 2024 13:24:41 -0700 Subject: [PATCH] Remove unnecessary lambdas in timeout tests (#121101) --- tests/util/test_timeout.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/util/test_timeout.py b/tests/util/test_timeout.py index 797c849db3c..496096bd740 100644 --- a/tests/util/test_timeout.py +++ b/tests/util/test_timeout.py @@ -25,7 +25,7 @@ async def test_simple_global_timeout_with_executor_job(hass: HomeAssistant) -> N with pytest.raises(TimeoutError): async with timeout.async_timeout(0.1): - await hass.async_add_executor_job(lambda: time.sleep(0.2)) + await hass.async_add_executor_job(time.sleep, 0.2) async def test_simple_global_timeout_freeze() -> None: @@ -133,7 +133,7 @@ async def test_mix_global_timeout_freeze_and_zone_freeze_inside_executor_job_sec async with timeout.async_timeout(0.1): async with timeout.async_timeout(0.2, zone_name="recorder"): await hass.async_add_executor_job(_some_sync_work) - await hass.async_add_executor_job(lambda: time.sleep(0.2)) + await hass.async_add_executor_job(time.sleep, 0.2) async def test_simple_global_timeout_freeze_with_executor_job( @@ -143,7 +143,7 @@ async def test_simple_global_timeout_freeze_with_executor_job( timeout = TimeoutManager() async with timeout.async_timeout(0.2), timeout.async_freeze(): - await hass.async_add_executor_job(lambda: time.sleep(0.3)) + await hass.async_add_executor_job(time.sleep, 0.3) async def test_simple_global_timeout_freeze_reset() -> None: