| 1 |
From: Colin Watson <[email protected]> |
| 2 |
Date: Mon, 13 Oct 2025 16:08:54 +0800 |
| 3 |
Subject: Port to pytest-asyncio >= 1.0.0 |
| 4 |
|
| 5 |
--- |
| 6 |
tests/conftest.py | 8 +++++--- |
| 7 |
1 file changed, 5 insertions(+), 3 deletions(-) |
| 8 |
|
| 9 |
diff --git a/tests/conftest.py b/tests/conftest.py |
| 10 |
index e554b95..e9aefbe 100644 |
| 11 |
--- a/tests/conftest.py |
| 12 |
+++ b/tests/conftest.py |
| 13 |
@@ -1,5 +1,6 @@ |
| 14 |
from __future__ import annotations |
| 15 |
|
| 16 |
+import asyncio |
| 17 |
import logging |
| 18 |
from collections.abc import Awaitable, Callable, Generator |
| 19 |
from json import JSONDecodeError |
| 20 |
@@ -7,6 +8,7 @@ from typing import Any, cast |
| 21 |
|
| 22 |
import aiohttp |
| 23 |
import pytest |
| 24 |
+import pytest_asyncio |
| 25 |
from aiohttp import web |
| 26 |
|
| 27 |
from rtsp_to_webrtc import diagnostics |
| 28 |
@@ -14,9 +16,9 @@ from rtsp_to_webrtc import diagnostics |
| 29 |
_LOGGER = logging.getLogger(__name__) |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
+@pytest_asyncio.fixture |
| 36 |
+async def loop() -> Any: |
| 37 |
+ return asyncio.get_running_loop() |
| 38 |
|
| 39 |
|
| 40 |
async def handler(request: aiohttp.web.Request) -> aiohttp.web.Response: |