From 2ef7cba5f8d47d059d666683e7dcf01af214596f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sat, 4 Oct 2025 19:17:44 +0200 Subject: [PATCH] Fix test compatibility with pytest-asyncio >= 1.0.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the obsolete `event_loop` fixture with `asyncio.get_running_loop()`, to fix testing with newer versions of `pytest-asyncio`. This change is backwards compatible. Signed-off-by: Michał Górny --- tests/test_connector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_connector.py b/tests/test_connector.py index 988fc20..e24ef48 100644 --- a/tests/test_connector.py +++ b/tests/test_connector.py @@ -272,7 +272,6 @@ async def test_socks5_open_connection(url, rdns, target_ssl_context): async def test_socks5_http_create_connection( url: str, rdns: bool, - event_loop: asyncio.AbstractEventLoop, target_ssl_context: ssl.SSLContext, ): url = URL(url) @@ -281,6 +280,7 @@ async def test_socks5_http_create_connection( if url.scheme == 'https': ssl_context = target_ssl_context + event_loop = asyncio.get_running_loop() reader = asyncio.StreamReader(loop=event_loop) protocol = asyncio.StreamReaderProtocol(reader, loop=event_loop)