Source: aiohttp-sse
Version: 2.2.0-2
Severity: serious
Tags: ftbfs upstream
Justification: FTBFS
python3-pytest-asyncio >= 1.0.0 caused aiohttp-sse to FTBFS with lots of
test failures along the following lines:
_________ ERROR at setup of test_func[debug:true-without_sse_response] _________
file
/build/reproducible-path/aiohttp-sse-2.2.0/.pybuild/cpython3_3.13/build/tests/test_sse.py,
line 16
@pytest.mark.parametrize(
"with_sse_response",
(False, True),
ids=("without_sse_response", "with_sse_response"),
)
async def test_func(with_sse_response: bool, aiohttp_client: ClientFixture)
-> None:
async def func(request: web.Request) -> web.StreamResponse:
if with_sse_response:
resp = await sse_response(request, headers={"X-SSE":
"aiohttp_sse"})
else:
resp = EventSourceResponse(headers={"X-SSE": "aiohttp_sse"})
await resp.prepare(request)
await resp.send("foo")
await resp.send("foo", event="bar")
await resp.send("foo", event="bar", id="xyz")
await resp.send("foo", event="bar", id="xyz", retry=1)
resp.stop_streaming()
await resp.wait()
return resp
app = web.Application()
app.router.add_route("GET", "/", func)
app.router.add_route("POST", "/", func)
client = await aiohttp_client(app)
resp = await client.get("/")
assert 200 == resp.status
# make sure that EventSourceResponse supports passing
# custom headers
assert resp.headers.get("X-SSE") == "aiohttp_sse"
# make sure default headers set
assert resp.headers.get("Content-Type") == "text/event-stream"
assert resp.headers.get("Cache-Control") == "no-cache"
assert resp.headers.get("Connection") == "keep-alive"
assert resp.headers.get("X-Accel-Buffering") == "no"
# check streamed data
streamed_data = await resp.text()
expected = (
"data: foo\r\n\r\n"
"event: bar\r\ndata: foo\r\n\r\n"
"id: xyz\r\nevent: bar\r\ndata: foo\r\n\r\n"
"id: xyz\r\nevent: bar\r\ndata: foo\r\nretry: 1\r\n\r\n"
)
assert streamed_data == expected
file
/build/reproducible-path/aiohttp-sse-2.2.0/.pybuild/cpython3_3.13/build/tests/conftest.py,
line 16
@pytest.fixture(autouse=True)
def loop(event_loop: AbstractEventLoop, debug: bool) -> AbstractEventLoop:
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,
> cache, capfd, capfdbinary, caplog, capsys, capsysbinary, capteesys, cov,
> debug, doctest_namespace, event_loop_policy, loop, monkeypatch, no_cover,
> pytestconfig, record_property, record_testsuite_property,
> record_xml_attribute, recwarn, 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.
I filed https://github.com/aio-libs/aiohttp-sse/pull/597 upstream to fix
this, so you should just be able to cherry-pick that patch.
Thanks,
--
Colin Watson (he/him) [[email protected]]