()
| 732 | records=async_records() if asynchronous else records()) |
| 733 | |
| 734 | async def run(): |
| 735 | await con.execute('CREATE TEMP TABLE copytab (a bytea)') |
| 736 | with self.assertRaises(ValueError) as caught: |
| 737 | if transaction: |
| 738 | async with con.transaction(): |
| 739 | await copy() |
| 740 | else: |
| 741 | await copy() |
| 742 | self.assertIs(caught.exception, error) |
| 743 | self.assertFalse(con.is_in_transaction()) |
| 744 | self.assertEqual( |
| 745 | await con.fetchval('SELECT count(*) FROM copytab'), 0) |
| 746 | self.assertEqual(await con.copy_records_to_table( |
| 747 | 'copytab', records=[(b'recovered',)]), 'COPY 1') |
| 748 | self.assertEqual( |
| 749 | await con.fetchval('SELECT a FROM copytab'), b'recovered') |
| 750 | await con.close() |
| 751 | |
| 752 | try: |
| 753 | # Bound recovery and close as well as COPY itself: cancellation |
nothing calls this directly
no test coverage detected