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

Method test_cursor_iterable_03

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

Source from the content-addressed store, hash-verified

49 await it.__anext__()
50
51 async def test_cursor_iterable_03(self):
52 st = await self.con.prepare('SELECT generate_series(0, 20)')
53
54 it = st.cursor().__aiter__()
55 if inspect.isawaitable(it):
56 it = await it
57
58 st._state.mark_closed()
59
60 with self.assertRaisesRegex(asyncpg.InterfaceError,
61 'statement is closed'):
62 async for _ in it: # NOQA
63 pass
64
65 async def test_cursor_iterable_04(self):
66 st = await self.con.prepare('SELECT generate_series(0, 20)')

Callers

nothing calls this directly

Calls 3

prepareMethod · 0.80
__aiter__Method · 0.45
cursorMethod · 0.45

Tested by

no test coverage detected