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

Method test_prepare_explicitly_named

tests/test_prepare.py:604–613  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 3

get_nameMethod · 0.80
prepareMethod · 0.45
fetchvalMethod · 0.45

Tested by

no test coverage detected