1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Bump aiohttp to 3.10.6rc2 (#126468)

This commit is contained in:
J. Nick Koston
2024-09-24 01:51:08 -05:00
committed by GitHub
parent 450b682c5c
commit 31200040da
7 changed files with 55 additions and 20 deletions

View File

@@ -5,6 +5,7 @@ from collections.abc import Iterator
from contextlib import contextmanager
from http import HTTPStatus
import re
from types import TracebackType
from typing import Any
from unittest import mock
from urllib.parse import parse_qs
@@ -166,7 +167,7 @@ class AiohttpClientMockResponse:
def __init__(
self,
method,
url,
url: URL,
status=HTTPStatus.OK,
response=None,
json=None,
@@ -297,6 +298,18 @@ class AiohttpClientMockResponse:
raise ClientConnectionError("Connection closed")
return self._response
async def __aenter__(self):
"""Enter the context manager."""
return self
async def __aexit__(
self,
exc_type: type[BaseException] | None,
exc_val: BaseException | None,
exc_tb: TracebackType | None,
) -> None:
"""Exit the context manager."""
@contextmanager
def mock_aiohttp_client() -> Iterator[AiohttpClientMocker]: