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