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
This commit is contained in:
voidborne-d 2026-03-16 02:08:00 +00:00
parent 0c895e87f2
commit 4dfb55773b

View file

@ -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 ────────────────────────────────────────────────────────────────