[issue32153] mock.create_autospec fails if an attribute is a partial function

2017-11-28 Thread Claudiu Belu
Change by Claudiu Belu : -- versions: -Python 3.8 ___ Python tracker <https://bugs.python.org/issue32153> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32153] mock.create_autospec fails if an attribute is a partial function

2017-11-28 Thread Claudiu Belu
New submission from Claudiu Belu : If an object's attribute is a partial function, mock.create_autospec will fail while trying to copy the partial functions' details to the mocked function, as the partial function does not have the __name__ attribute. Example: import functools

[issue32092] mock.patch with autospec does not consume self / cls argument

2017-11-20 Thread Claudiu Belu
Change by Claudiu Belu : -- keywords: +patch pull_requests: +4412 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue32092> ___ ___ Py

[issue30587] Mock with spec object does not ensure method call signatures

2017-11-20 Thread Claudiu Belu
Change by Claudiu Belu : -- keywords: +patch pull_requests: +4411 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue30587> ___ ___ Py

[issue32092] mock.patch with autospec does not consume self / cls argument

2017-11-20 Thread Claudiu Belu
Claudiu Belu added the comment: Currently, the autospec=True argument can be passed to mock.patch, but when trying to make assertions on the call and its arguments, it can fail, as it expects an instance / class instance reference as the first argument (self / cls arguments are not consumed

[issue32092] mock.patch with autospec does not consume self / cls argument

2017-11-20 Thread Claudiu Belu
Change by Claudiu Belu : -- components: +Library (Lib) ___ Python tracker <https://bugs.python.org/issue32092> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32092] mock.patch with autospec does not consume self / cls argument

2017-11-20 Thread Claudiu Belu
Change by Claudiu Belu : -- type: -> behavior ___ Python tracker <https://bugs.python.org/issue32092> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue32092] mock.patch with autospec does not consume self / cls argument

2017-11-20 Thread Claudiu Belu
New submission from Claudiu Belu : Currently, the autospec=True argument can be passed to mock.patch, but when trying to make assertions on the call and its arguments, it can fail, as it expects an instance / class instance reference as the first argument (self / cls arguments are not

[issue30587] Mock with spec object does not ensure method call signatures

2017-06-07 Thread Claudiu Belu
New submission from Claudiu Belu: Mock can accept a spec object / class as argument, making sure that accessing attributes that do not exist in the spec will cause an AttributeError to be raised, but there is no guarantee that the spec's methods signatures are respected in any way.