From f561bbc14cf7552cb85b37e7d56d31602fa0206c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 8 Jan 2023 23:42:31 +0200 Subject: [PATCH] Address a few deprecation warnings in tests --- tests/conftest.py | 2 +- tests/test_core.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 75655cf2d8682..6cfd4d158232d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -627,7 +627,7 @@ def current_request(): "GET", "/some/request", headers={"Host": "example.com"}, - sslcontext=ssl.SSLContext(ssl.PROTOCOL_TLS), + sslcontext=ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT), ) mock_request_context.get.return_value = mocked_request yield mock_request_context diff --git a/tests/test_core.py b/tests/test_core.py index 2f8db7fc0d6d4..d7ea89b2c41ff 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1128,7 +1128,12 @@ async def handle_outer(call): call2 = hass.services.async_call( "test", "inner", blocking=True, context=call.context ) - await asyncio.wait([call1, call2]) + await asyncio.wait( + [ + hass.async_create_task(call1), + hass.async_create_task(call2), + ] + ) calls.append(call) hass.services.async_register("test", "outer", handle_outer)