async def test_begin(): await _init() async with pg.begin() as conn: for row in await conn.fetch(query): assert row.a == 4.0
async def inner(connection=None, **kwargs): if connection is not None: return await func(connection=connection, **kwargs) async with pg.begin() as conn: return await func(connection=conn, **kwargs)
async def test_begin(): async with pg.begin() as conn: for row in await conn.fetch(query): assert row['a'] == 4.0