From 432c4c55b38e820c98ec76135c202d6cdfc2e8d4 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sat, 5 Jan 2019 03:11:02 +0100 Subject: [PATCH] Use real TLS context where it's disabled in tests --- tests/test_client_functional.py | 7 +++++-- tests/test_client_request.py | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_client_functional.py b/tests/test_client_functional.py index 75becaf9e9b..0d490ac627f 100644 --- a/tests/test_client_functional.py +++ b/tests/test_client_functional.py @@ -264,8 +264,11 @@ async def handler(request): assert 200 == resp.status -async def test_ssl_client(ssl_ctx, aiohttp_server, aiohttp_client) -> None: - connector = aiohttp.TCPConnector(ssl=False) +async def test_ssl_client( + aiohttp_server, ssl_ctx, + aiohttp_client, client_ssl_ctx, +) -> None: + connector = aiohttp.TCPConnector(ssl=client_ssl_ctx) async def handler(request): return web.Response(text='Test message') diff --git a/tests/test_client_request.py b/tests/test_client_request.py index 98c085f217d..4388d9ce60b 100644 --- a/tests/test_client_request.py +++ b/tests/test_client_request.py @@ -1270,11 +1270,11 @@ async def create_connection(req, traces, timeout): conn.close() -def test_verify_ssl_false_with_ssl_context(loop) -> None: +def test_verify_ssl_false_with_ssl_context(loop, ssl_ctx) -> None: with pytest.warns(DeprecationWarning): with pytest.raises(ValueError): _merge_ssl_params(None, verify_ssl=False, - ssl_context=mock.Mock(), fingerprint=None) + ssl_context=ssl_ctx, fingerprint=None) def test_bad_fingerprint(loop) -> None: