(self)
| 14 | class TestIterableCursor(tb.ConnectedTestCase): |
| 15 | |
| 16 | async def test_cursor_iterable_01(self): |
| 17 | st = await self.con.prepare('SELECT generate_series(0, 20)') |
| 18 | expected = await st.fetch() |
| 19 | |
| 20 | for prefetch in range(1, 25): |
| 21 | with self.subTest(prefetch=prefetch): |
| 22 | async with self.con.transaction(): |
| 23 | result = [] |
| 24 | async for rec in st.cursor(prefetch=prefetch): |
| 25 | result.append(rec) |
| 26 | |
| 27 | self.assertEqual( |
| 28 | result, expected, |
| 29 | 'result != expected for prefetch={}'.format(prefetch)) |
| 30 | |
| 31 | async def test_cursor_iterable_02(self): |
| 32 | # Test that it's not possible to create a cursor without hold |
nothing calls this directly
no test coverage detected