(self)
| 81 | pass |
| 82 | |
| 83 | async def test_cursor_iterable_06(self): |
| 84 | recs = [] |
| 85 | |
| 86 | async with self.con.transaction(): |
| 87 | await self.con.execute(''' |
| 88 | CREATE TABLE cursor_iterable_06 (id int); |
| 89 | INSERT INTO cursor_iterable_06 VALUES (0), (1); |
| 90 | ''') |
| 91 | try: |
| 92 | cur = self.con.cursor('SELECT * FROM cursor_iterable_06') |
| 93 | async for rec in cur: |
| 94 | recs.append(rec) |
| 95 | finally: |
| 96 | # Check that after iteration has exhausted the cursor, |
| 97 | # its associated portal is closed properly, unlocking |
| 98 | # the table. |
| 99 | await self.con.execute('DROP TABLE cursor_iterable_06') |
| 100 | |
| 101 | self.assertEqual(recs, [(i,) for i in range(2)]) |
| 102 | |
| 103 | |
| 104 | class TestCursor(tb.ConnectedTestCase): |
nothing calls this directly
no test coverage detected