| 299 | event = asyncio.Event() |
| 300 | |
| 301 | async def locker(): |
| 302 | test_func = getattr(self, self._testMethodName).__func__ |
| 303 | opts = getattr(test_func, '__connect_options__', {}) |
| 304 | conn = await self.connect(**opts) |
| 305 | try: |
| 306 | tx = conn.transaction() |
| 307 | await tx.start() |
| 308 | await conn.execute("UPDATE exmany SET a = '1' WHERE b = 10") |
| 309 | event.set() |
| 310 | await asyncio.sleep(1) |
| 311 | await tx.rollback() |
| 312 | finally: |
| 313 | event.set() |
| 314 | await conn.close() |
| 315 | |
| 316 | await self.con.executemany(''' |
| 317 | INSERT INTO exmany VALUES(NULL, $1) |