From 29151021f957a524f612e9effc20ede8538195ab Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 10 Aug 2024 11:09:58 -0500 Subject: [PATCH] Fix type ignore in SSLContext creation connector test (#8676) --- tests/test_connector.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_connector.py b/tests/test_connector.py index 0e5b7dde2c6..ea30e571b95 100644 --- a/tests/test_connector.py +++ b/tests/test_connector.py @@ -20,6 +20,7 @@ Optional, Sequence, Tuple, + Type, ) from unittest import mock @@ -1799,16 +1800,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)