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

Method test_exceptions_unpacking

tests/test_exceptions.py:25–34  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

23 self.assertIsNone(asyncpg.PostgresError.schema_name)
24
25 async def test_exceptions_unpacking(self):
26 try:
27 await self.con.execute('SELECT * FROM _nonexistent_')
28 except asyncpg.UndefinedTableError as e:
29 self.assertEqual(e.sqlstate, '42P01')
30 self.assertEqual(e.position, '15')
31 self.assertEqual(e.query, 'SELECT * FROM _nonexistent_')
32 self.assertIsNotNone(e.severity)
33 else:
34 self.fail('UndefinedTableError not raised')
35
36 async def test_exceptions_str(self):
37 try:

Callers

nothing calls this directly

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected