This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lisroach
Recipients lisroach
Date 2019-09-13.17:05:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1568394304.53.0.898247355535.issue38163@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-09-13 17:05:04lisroachsetrecipients: + lisroach
2019-09-13 17:05:04lisroachsetmessageid: <1568394304.53.0.898247355535.issue38163@roundup.psfhosted.org>
2019-09-13 17:05:04lisroachlinkissue38163 messages
2019-09-13 17:05:04lisroachcreate