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

Method test_prepare_21_errors

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

Source from the content-addressed store, hash-verified

395 self.assertEqual(await vf, val)
396
397 async def test_prepare_21_errors(self):
398 stmt = await self.con.prepare('SELECT 10 / $1::int')
399
400 with self.assertRaises(asyncpg.DivisionByZeroError):
401 await stmt.fetchval(0)
402
403 self.assertEqual(await stmt.fetchval(5), 2)
404
405 async def test_prepare_22_empty(self):
406 # Support for empty target list was added in PostgreSQL 9.4

Callers

nothing calls this directly

Calls 2

prepareMethod · 0.80
fetchvalMethod · 0.45

Tested by

no test coverage detected