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

Method test_prepare_09_raise_error

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

Source from the content-addressed store, hash-verified

127 list(range(10001)))
128
129 async def test_prepare_09_raise_error(self):
130 # Stress test ReadBuffer.read_cstr()
131 msg = '0' * 1024 * 100
132 query = """
133 DO language plpgsql $$
134 BEGIN
135 RAISE EXCEPTION '{}';
136 END
137 $$;""".format(msg)
138
139 stmt = await self.con.prepare(query)
140 with self.assertRaisesRegex(asyncpg.RaiseError, msg):
141 with tb.silence_asyncio_long_exec_warning():
142 await stmt.fetchval()
143
144 async def test_prepare_10_stmt_lru(self):
145 cache = self.con._stmt_cache

Callers

nothing calls this directly

Calls 2

prepareMethod · 0.45
fetchvalMethod · 0.45

Tested by

no test coverage detected