MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / test_cursor_external_transaction

Method test_cursor_external_transaction

tests/test_cursor.py:112–121  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

110 await st.cursor()
111
112 async def test_cursor_external_transaction(self):
113 await self.con.execute('BEGIN')
114 try:
115 st = await self.con.prepare('SELECT generate_series(0, 2)')
116 cur = await st.cursor()
117 self.assertEqual(
118 await cur.fetch(10),
119 [(0,), (1,), (2,)])
120 finally:
121 await self.con.execute('ROLLBACK')
122
123 async def test_cursor_02(self):
124 st = await self.con.prepare('SELECT generate_series(0, 20)')

Callers

nothing calls this directly

Calls 4

executeMethod · 0.45
prepareMethod · 0.45
cursorMethod · 0.45
fetchMethod · 0.45

Tested by

no test coverage detected