mirror of
https://github.com/home-assistant/core.git
synced 2026-11-27 16:17:33 -04:00
Bump to aiohttp 3.8.0 (#58974)
This commit is contained in:
@@ -119,7 +119,7 @@ async def test_login_view(hass, cloud_client):
|
||||
|
||||
async def test_login_view_random_exception(cloud_client):
|
||||
"""Try logging in with invalid JSON."""
|
||||
with patch("async_timeout.timeout", side_effect=ValueError("Boom")):
|
||||
with patch("hass_nabucasa.Cloud.login", side_effect=ValueError("Boom")):
|
||||
req = await cloud_client.post(
|
||||
"/api/cloud/login", json={"email": "my_username", "password": "my_password"}
|
||||
)
|
||||
|
||||
@@ -3,7 +3,9 @@ import asyncio
|
||||
from http import HTTPStatus
|
||||
from unittest.mock import patch
|
||||
|
||||
import aiohttp
|
||||
import httpx
|
||||
import pytest
|
||||
import respx
|
||||
|
||||
from homeassistant import config as hass_config
|
||||
@@ -132,10 +134,13 @@ async def test_limit_refetch(hass, hass_client):
|
||||
|
||||
hass.states.async_set("sensor.temp", "5")
|
||||
|
||||
with patch("async_timeout.timeout", side_effect=asyncio.TimeoutError()):
|
||||
with pytest.raises(aiohttp.ServerTimeoutError), patch(
|
||||
"async_timeout.timeout", side_effect=asyncio.TimeoutError()
|
||||
):
|
||||
resp = await client.get("/api/camera_proxy/camera.config_test")
|
||||
assert respx.calls.call_count == 0
|
||||
assert resp.status == HTTPStatus.INTERNAL_SERVER_ERROR
|
||||
|
||||
assert respx.calls.call_count == 0
|
||||
assert resp.status == HTTPStatus.INTERNAL_SERVER_ERROR
|
||||
|
||||
hass.states.async_set("sensor.temp", "10")
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ async def test_camera_image_failed_start_stream_call(hass: HomeAssistant) -> Non
|
||||
await setup_test_config_entry(hass, hyperion_client=client)
|
||||
|
||||
with pytest.raises(HomeAssistantError):
|
||||
await async_get_image(hass, TEST_CAMERA_ENTITY_ID, timeout=0)
|
||||
await async_get_image(hass, TEST_CAMERA_ENTITY_ID, timeout=0.01)
|
||||
|
||||
assert client.async_send_image_stream_start.called
|
||||
assert not client.async_send_image_stream_stop.called
|
||||
|
||||
@@ -95,13 +95,13 @@ class SaveRecordWorkerSync:
|
||||
|
||||
async def get_segments(self):
|
||||
"""Return the recorded video segments."""
|
||||
with async_timeout.timeout(TEST_TIMEOUT):
|
||||
async with async_timeout.timeout(TEST_TIMEOUT):
|
||||
await self._save_event.wait()
|
||||
return self._segments
|
||||
|
||||
async def join(self):
|
||||
"""Verify save worker was invoked and block on shutdown."""
|
||||
with async_timeout.timeout(TEST_TIMEOUT):
|
||||
async with async_timeout.timeout(TEST_TIMEOUT):
|
||||
await self._save_event.wait()
|
||||
self._save_thread.join(timeout=TEST_TIMEOUT)
|
||||
assert not self._save_thread.is_alive()
|
||||
|
||||
@@ -369,7 +369,7 @@ async def test_subscribe_unsubscribe_events(hass, websocket_client):
|
||||
hass.bus.async_fire("test_event", {"hello": "world"})
|
||||
hass.bus.async_fire("ignore_event")
|
||||
|
||||
with timeout(3):
|
||||
async with timeout(3):
|
||||
msg = await websocket_client.receive_json()
|
||||
|
||||
assert msg["id"] == 5
|
||||
@@ -566,7 +566,7 @@ async def test_subscribe_unsubscribe_events_whitelist(
|
||||
|
||||
hass.bus.async_fire("themes_updated")
|
||||
|
||||
with timeout(3):
|
||||
async with timeout(3):
|
||||
msg = await websocket_client.receive_json()
|
||||
|
||||
assert msg["id"] == 6
|
||||
@@ -1051,7 +1051,7 @@ async def test_subscribe_trigger(hass, websocket_client):
|
||||
hass.bus.async_fire("test_event", {"hello": "world"}, context=context)
|
||||
hass.bus.async_fire("ignore_event")
|
||||
|
||||
with timeout(3):
|
||||
async with timeout(3):
|
||||
msg = await websocket_client.receive_json()
|
||||
|
||||
assert msg["id"] == 5
|
||||
|
||||
Reference in New Issue
Block a user