MCPcopy
hub / github.com/psycopg/psycopg / test_cursor_close_fetchmany

Function test_cursor_close_fetchmany

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

Source from the content-addressed store, hash-verified

201
202
203async def test_cursor_close_fetchmany(aconn):
204 cur = aconn.cursor("foo")
205 assert not cur.closed
206
207 query = "select * from generate_series(1, 10)"
208 await cur.execute(query)
209 assert len(await cur.fetchmany(2)) == 2
210
211 await cur.close()
212 assert cur.closed
213
214 with pytest.raises(e.InterfaceError):
215 await cur.fetchmany(2)
216
217
218async def test_cursor_close_fetchall(aconn):

Callers

nothing calls this directly

Calls 4

cursorMethod · 0.45
executeMethod · 0.45
fetchmanyMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected