| 602 | self.assertEqual(len(cache), 0) |
| 603 | |
| 604 | async def test_prepare_explicitly_named(self): |
| 605 | ps = await self.con.prepare('select 1', name='foobar') |
| 606 | self.assertEqual(ps.get_name(), 'foobar') |
| 607 | self.assertEqual(await self.con.fetchval('EXECUTE foobar'), 1) |
| 608 | |
| 609 | with self.assertRaisesRegex( |
| 610 | exceptions.DuplicatePreparedStatementError, |
| 611 | 'prepared statement "foobar" already exists', |
| 612 | ): |
| 613 | await self.con.prepare('select 1', name='foobar') |
| 614 | |
| 615 | async def test_prepare_fetchmany(self): |
| 616 | tr = self.con.transaction() |