From: Daniele Varrazzo Date: Tue, 2 Dec 2025 17:54:26 +0000 (+0100) Subject: fix: add test to verify iteration in server-side cursor broken X-Git-Tag: 3.3.1~1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a75357de22bb63ede33006cd17c99b30e360cdf;p=thirdparty%2Fpsycopg.git fix: add test to verify iteration in server-side cursor broken See #1226 --- diff --git a/tests/test_cursor_server.py b/tests/test_cursor_server.py index cd680b29a..9986a53ab 100644 --- a/tests/test_cursor_server.py +++ b/tests/test_cursor_server.py @@ -446,7 +446,7 @@ def test_itersize(conn, commands): cur.execute(ph(cur, "select generate_series(1, %s) as bar"), (3,)) commands.popall() # flush begin and other noise - list(cur) + assert list(cur) == [(1,), (2,), (3,)] cmds = commands.popall() assert len(cmds) == 2 for cmd in cmds: diff --git a/tests/test_cursor_server_async.py b/tests/test_cursor_server_async.py index 5a56b2c13..025b0b777 100644 --- a/tests/test_cursor_server_async.py +++ b/tests/test_cursor_server_async.py @@ -452,7 +452,7 @@ async def test_itersize(aconn, acommands): await cur.execute(ph(cur, "select generate_series(1, %s) as bar"), (3,)) acommands.popall() # flush begin and other noise - await alist(cur) + assert await alist(cur) == [(1,), (2,), (3,)] cmds = acommands.popall() assert len(cmds) == 2 for cmd in cmds: