Use builtin TimeoutError [a-d] (#109678)

This commit is contained in:
Marc Mueller
2024-02-05 11:31:33 +01:00
committed by GitHub
parent 41a256a3ff
commit c82933175d
63 changed files with 97 additions and 137 deletions

View File

@@ -1,5 +1,4 @@
"""The tests for the camera component."""
import asyncio
from http import HTTPStatus
import io
from types import ModuleType
@@ -204,7 +203,7 @@ async def test_get_image_with_timeout(hass: HomeAssistant, image_mock_url) -> No
"""Try to get image with timeout."""
with patch(
"homeassistant.components.demo.camera.DemoCamera.async_camera_image",
side_effect=asyncio.TimeoutError,
side_effect=TimeoutError,
), pytest.raises(HomeAssistantError):
await camera.async_get_image(hass, "camera.demo_camera")
@@ -670,7 +669,7 @@ async def test_websocket_web_rtc_offer_timeout(
with patch(
"homeassistant.components.camera.Camera.async_handle_web_rtc_offer",
side_effect=asyncio.TimeoutError(),
side_effect=TimeoutError(),
):
await client.send_json(
{