From 4dfb55773bb30adacab1036b7d6047bb3ed52077 Mon Sep 17 00:00:00 2001 From: voidborne-d Date: Mon, 16 Mar 2026 02:08:00 +0000 Subject: [PATCH] fix: use asyncio.run() and remove unused pytest import in tests Address review feedback: - Replace deprecated asyncio.get_event_loop().run_until_complete() with asyncio.run() - Remove unused pytest import --- tests/mcp_tests/test_mcp_trailing_slash_middleware.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/mcp_tests/test_mcp_trailing_slash_middleware.py b/tests/mcp_tests/test_mcp_trailing_slash_middleware.py index 28989d37f14..edcbe6b9ccf 100644 --- a/tests/mcp_tests/test_mcp_trailing_slash_middleware.py +++ b/tests/mcp_tests/test_mcp_trailing_slash_middleware.py @@ -8,8 +8,6 @@ everything else through unchanged. import asyncio -import pytest - # The middleware is defined at module scope in proxy_server.py alongside heavy # imports we don't want here. Re-implement the same class locally to test the @@ -55,7 +53,7 @@ def _make_http_scope(path: str, raw_path: bytes | None = None) -> dict: def _run(coro): - return asyncio.get_event_loop().run_until_complete(coro) + return asyncio.run(coro) # ── tests ────────────────────────────────────────────────────────────────