Message353263
This should be simple to do, after https://github.com/python/cpython/pull/16060 we can add:
elif self._mock_methods and _new_name in self._mock_methods:
# Methods that are not in _spec_asyncs are normal methods
klass = MagicMock
to _get_child_mocks and test with:
def test_normal_methods_on_class(self):
am = AsyncMock(AsyncClass)
self.assertIsInstance(am.async_method, AsyncMock)
self.assertIsInstance(am.normal_method, MagicMock)
This might be starting to make _get_child_mocks too complicated, and no longer follows the default "child mocks are the same as their parent". I am not sure how to redefine _get_child_mocks without needing to double up a lot of code to support MagicMocks having AsyncMock child_mocks as well. |
|
Date |
User |
Action |
Args |
2019-09-26 05:02:10 | lisroach | set | recipients:
+ lisroach, xtreak |
2019-09-26 05:02:10 | lisroach | set | messageid: <1569474130.28.0.0378830797463.issue38163@roundup.psfhosted.org> |
2019-09-26 05:02:10 | lisroach | link | issue38163 messages |
2019-09-26 05:02:10 | lisroach | create | |
|