Use asyncio.timeout [core] (#98447)

This commit is contained in:
Marc Mueller 2023-08-15 15:36:05 +02:00 committed by GitHub
parent e2d2ec8817
commit a9ade1f84d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 77 additions and 96 deletions

View file

@ -9,7 +9,6 @@ from types import MappingProxyType
from unittest import mock
from unittest.mock import AsyncMock, MagicMock, patch
from async_timeout import timeout
import pytest
import voluptuous as vol
@ -1000,7 +999,7 @@ async def test_wait_basic_times_out(hass: HomeAssistant, action_type) -> None:
assert script_obj.last_action == wait_alias
hass.states.async_set("switch.test", "not_on")
async with timeout(0.1):
async with asyncio.timeout(0.1):
await hass.async_block_till_done()
except asyncio.TimeoutError:
timed_out = True
@ -1386,7 +1385,7 @@ async def test_wait_template_with_utcnow_no_match(hass: HomeAssistant) -> None:
):
async_fire_time_changed(hass, second_non_matching_time)
async with timeout(0.1):
async with asyncio.timeout(0.1):
await hass.async_block_till_done()
except asyncio.TimeoutError:
timed_out = True