(self)
| 353 | |
| 354 | @tb.with_connection_options(record_class=CustomRecord) |
| 355 | async def test_record_subclass_01(self): |
| 356 | r = await self.con.fetchrow("SELECT 1 as a, '2' as b") |
| 357 | self.assertIsInstance(r, CustomRecord) |
| 358 | |
| 359 | r = await self.con.fetch("SELECT 1 as a, '2' as b") |
| 360 | self.assertIsInstance(r[0], CustomRecord) |
| 361 | |
| 362 | async with self.con.transaction(): |
| 363 | cur = await self.con.cursor("SELECT 1 as a, '2' as b") |
| 364 | r = await cur.fetchrow() |
| 365 | self.assertIsInstance(r, CustomRecord) |
| 366 | |
| 367 | cur = await self.con.cursor("SELECT 1 as a, '2' as b") |
| 368 | r = await cur.fetch(1) |
| 369 | self.assertIsInstance(r[0], CustomRecord) |
| 370 | |
| 371 | async with self.con.transaction(): |
| 372 | cur = self.con.cursor("SELECT 1 as a, '2' as b") |
| 373 | async for r in cur: |
| 374 | self.assertIsInstance(r, CustomRecord) |
| 375 | |
| 376 | ps = await self.con.prepare("SELECT 1 as a, '2' as b") |
| 377 | r = await ps.fetchrow() |
| 378 | self.assertIsInstance(r, CustomRecord) |
| 379 | |
| 380 | async def test_record_subclass_02(self): |
| 381 | r = await self.con.fetchrow( |
nothing calls this directly
no test coverage detected