[issue40406] MagicMock __aenter__ should be AsyncMock(return_value=MagicMock())

Brian Curtin report at bugs.python.org
Fri May 1 20:13:33 EDT 2020


Brian Curtin <brian at python.org> added the comment:

graingert: Do you have a workaround for this? I'm doing roughly the same thing with an asyncpg connection pool nested with a transaction and am getting nowhere.


    async with pg_pool.acquire() as conn:
        async with conn.transaction():
            ...

----------
nosy: +brian.curtin

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40406>
_______________________________________


More information about the Python-bugs-list mailing list