Source: rtsp-to-webrtc
Version: 0.6.1-2
Severity: serious
Tags: ftbfs patch upstream
Justification: FTBFS
python3-pytest-asyncio >= 1.0.0 caused rtsp-to-webrtc to FTBFS with lots
of test failures along the following lines:
_____________________ ERROR at setup of test_list_streams ______________________
file
/build/reproducible-path/rtsp-to-webrtc-0.6.1/.pybuild/cpython3_3.13_rtsp-to-webrtc/build/tests/test_web_client.py,
line 100
async def test_list_streams(
cli: TestClient,
request_handler: Callable[[aiohttp.web.Request],
Awaitable[aiohttp.web.Response]],
) -> None:
"""Test List Streams calls."""
assert isinstance(cli.server, TestServer)
cli.server.app["response"].append(
aiohttp.web.json_response(
{
"status": 1,
"payload": {
"demo1": STREAM_1,
"demo2": STREAM_2,
},
}
)
)
client = WebClient(cast(ClientSession, cli))
streams = await client.list_streams()
assert len(streams) == 2
assert streams == {
"demo1": STREAM_1,
"demo2": STREAM_2,
}
requests = cli.server.app["request"]
assert requests == ["/streams"]
file
/build/reproducible-path/rtsp-to-webrtc-0.6.1/.pybuild/cpython3_3.13_rtsp-to-webrtc/build/tests/test_web_client.py,
line 89
@pytest.fixture
def cli(
file
/build/reproducible-path/rtsp-to-webrtc-0.6.1/.pybuild/cpython3_3.13_rtsp-to-webrtc/build/tests/conftest.py,
line 17
@pytest.fixture
def loop(event_loop: Any) -> Any:
E fixture 'event_loop' not found
> available fixtures: _class_scoped_runner, _function_scoped_runner,
> _module_scoped_runner, _package_scoped_runner, _session_scoped_runner,
> aiohttp_client, aiohttp_client_cls, aiohttp_raw_server, aiohttp_server, app,
> cache, capfd, capfdbinary, caplog, capsys, capsysbinary, capteesys, cli,
> doctest_namespace, event_loop_policy, loop, monkeypatch, pytestconfig,
> record_property, record_testsuite_property, record_xml_attribute, recwarn,
> request_handler, reset_diagnostics, setup_handler, tmp_path,
> tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port,
> unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory
> use 'pytest --fixtures [testpath]' for help on them.
The attached patch should fix this.
Incidentally, could you please fix Vcs-Browser and Vcs-Git in
debian/control? The mistakes there meant that I had to guess to find
this package's git repository.
Thanks,
--
Colin Watson (he/him) [[email protected]]
diff --git a/tests/conftest.py b/tests/conftest.py
index e554b95..e9aefbe 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,5 +1,6 @@
from __future__ import annotations
+import asyncio
import logging
from collections.abc import Awaitable, Callable, Generator
from json import JSONDecodeError
@@ -7,6 +8,7 @@ from typing import Any, cast
import aiohttp
import pytest
+import pytest_asyncio
from aiohttp import web
from rtsp_to_webrtc import diagnostics
@@ -14,9 +16,9 @@ from rtsp_to_webrtc import diagnostics
_LOGGER = logging.getLogger(__name__)
[email protected]
-def loop(event_loop: Any) -> Any:
- return event_loop
+@pytest_asyncio.fixture
+async def loop() -> Any:
+ return asyncio.get_running_loop()
async def handler(request: aiohttp.web.Request) -> aiohttp.web.Response: