MCPcopy
hub / github.com/psycopg/psycopg / test_fetchmany

Function test_fetchmany

tests/test_cursor_server_async.py:327–333  ·  view source on GitHub ↗
(aconn)

Source from the content-addressed store, hash-verified

325
326
327async def test_fetchmany(aconn):
328 async with aconn.cursor("foo") as cur:
329 await cur.execute(ph(cur, "select generate_series(1, %s) as bar"), (5,))
330 assert await cur.fetchmany(3) == [(1,), (2,), (3,)]
331 assert await cur.fetchone() == (4,)
332 assert await cur.fetchmany(3) == [(5,)]
333 assert await cur.fetchmany(3) == []
334
335
336async def test_fetchall(aconn):

Callers

nothing calls this directly

Calls 5

phFunction · 0.85
cursorMethod · 0.45
executeMethod · 0.45
fetchmanyMethod · 0.45
fetchoneMethod · 0.45

Tested by

no test coverage detected