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

Method locker

tests/test_execute.py:301–314  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 6

transactionMethod · 0.80
rollbackMethod · 0.80
connectMethod · 0.45
startMethod · 0.45
executeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected