Message352369
We want child mocks to match their "type" (async or sync).
Ex:
class Prod:
async def foo():
pass
def bar():
pass
a_mock = AsyncMock(Prod)
isinstance(a_mock.foo(), AsyncMock) == True
isinstance(a_mock.bar(), MagicMock) == True
Also this should include magic methods:
int(a_mock) should work and return 1 like MagicMocks do.
a_mock.__enter__ should exist and be a MagicMock, just as a_mock.__aenter__ exists and is an AsyncMock. |
|
Date |
User |
Action |
Args |
2019-09-13 17:05:04 | lisroach | set | recipients:
+ lisroach |
2019-09-13 17:05:04 | lisroach | set | messageid: <1568394304.53.0.898247355535.issue38163@roundup.psfhosted.org> |
2019-09-13 17:05:04 | lisroach | link | issue38163 messages |
2019-09-13 17:05:04 | lisroach | create | |
|