| 413 | self.assertEqual(repr(result), '<Record>') |
| 414 | |
| 415 | async def test_prepare_statement_invalid(self): |
| 416 | await self.con.execute('CREATE TABLE tab1(a int, b int)') |
| 417 | |
| 418 | try: |
| 419 | await self.con.execute('INSERT INTO tab1 VALUES (1, 2)') |
| 420 | |
| 421 | stmt = await self.con.prepare('SELECT * FROM tab1') |
| 422 | |
| 423 | await self.con.execute( |
| 424 | 'ALTER TABLE tab1 ALTER COLUMN b SET DATA TYPE text') |
| 425 | |
| 426 | with self.assertRaisesRegex(asyncpg.InvalidCachedStatementError, |
| 427 | 'cached statement plan is invalid'): |
| 428 | await stmt.fetchrow() |
| 429 | |
| 430 | finally: |
| 431 | await self.con.execute('DROP TABLE tab1') |
| 432 | |
| 433 | @tb.with_connection_options(statement_cache_size=0) |
| 434 | async def test_prepare_23_no_stmt_cache_seq(self): |