From 73d17d40b38ed71dd2066315313ffa53025912dd Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 10 Aug 2024 11:31:17 -0500 Subject: [PATCH] [PR #8676/2915102 backport][3.10] Fix type ignore in SSLContext creation connector test (#8677) --- tests/test_connector.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/test_connector.py b/tests/test_connector.py index 0d6ca18ef53..8dd7a294b30 100644 --- a/tests/test_connector.py +++ b/tests/test_connector.py @@ -10,7 +10,7 @@ import uuid from collections import deque from contextlib import closing -from typing import Any, List, Optional +from typing import Any, List, Optional, Type from unittest import mock import pytest @@ -1630,16 +1630,14 @@ async def test_ssl_context_once() -> None: @pytest.mark.parametrize("exception", [OSError, ssl.SSLError, asyncio.CancelledError]) -async def test_ssl_context_creation_raises(exception: BaseException) -> None: +async def test_ssl_context_creation_raises(exception: Type[BaseException]) -> None: """Test that we try again if SSLContext creation fails the first time.""" conn = aiohttp.TCPConnector() conn._made_ssl_context.clear() with mock.patch.object( conn, "_make_ssl_context", side_effect=exception - ), pytest.raises( # type: ignore[call-overload] - exception - ): + ), pytest.raises(exception): await conn._make_or_get_ssl_context(True) assert isinstance(await conn._make_or_get_ssl_context(True), ssl.SSLContext)