]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
fix: add test to verify iteration in server-side cursor broken
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 2 Dec 2025 17:54:26 +0000 (18:54 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 2 Dec 2025 17:54:26 +0000 (18:54 +0100)
See #1226

tests/test_cursor_server.py
tests/test_cursor_server_async.py

index cd680b29acf7c00ca6d88ba462ac71119a8398e3..9986a53abcb7ea2bfdb911c7bae3165b29c7611f 100644 (file)
@@ -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:
index 5a56b2c13e33fde05c9046db8378c69b32860aef..025b0b777154d9f36ce41eb44d2929e1d7eb0778 100644 (file)
@@ -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: