MCPcopy
hub / github.com/psycopg/psycopg / test_rownumber

Function test_rownumber

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

Source from the content-addressed store, hash-verified

407
408
409async def test_rownumber(aconn):
410 cur = aconn.cursor("foo")
411 assert cur.rownumber is None
412
413 await cur.execute("select 1 from generate_series(1, 42)")
414 assert cur.rownumber == 0
415
416 await cur.fetchone()
417 assert cur.rownumber == 1
418 await cur.fetchone()
419 assert cur.rownumber == 2
420 await cur.fetchmany(10)
421 assert cur.rownumber == 12
422 await cur.fetchall()
423 assert cur.rownumber == 42
424 await cur.close()
425
426
427async def test_iter(aconn):

Callers

nothing calls this directly

Calls 6

cursorMethod · 0.45
executeMethod · 0.45
fetchoneMethod · 0.45
fetchmanyMethod · 0.45
fetchallMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected