Message356226
If I understand this correctly, when an autospec of a class is created the attributes themselves of the given class are autospecced. During autospec of attributes it's modelled upon __call__'s signature for the given attributes [0]. Here you are wrapping the method's inside a class with Wrapper with a custom __call__ implementation. During actual calls the chain goes through __call__ and executes __get__ where bound method is called. But in mock I am not sure of a way where it can figure out __call__ and then look more into the body to see if there are actual calls being made to be mocked with current implementation just going through signature of __call__.
[0] https://github.com/python/cpython/blob/befa032d8869e0fab4732d910f3887642879d644/Lib/unittest/mock.py#L94 |
|
Date |
User |
Action |
Args |
2019-11-08 06:30:47 | xtreak | set | recipients:
+ xtreak, cjw296, michael.foord, lisroach, mariocj89, breilly_box |
2019-11-08 06:30:47 | xtreak | set | messageid: <1573194647.6.0.197747408334.issue38729@roundup.psfhosted.org> |
2019-11-08 06:30:47 | xtreak | link | issue38729 messages |
2019-11-08 06:30:47 | xtreak | create | |
|