Message327529
I think the original error has been fixed with issue28919 where the attribute errors are ignored while copying the functions as suggested by Anthony in solution 2. So can this issue be closed as outdated to reopen a new one for using update_wrapper as enhancement or the title can be changed to reflect the fact that autospec should now use update_wrapper instead of using _copy_func_details ? Correct me if I am wrong on the workflow to update the ticket.
Also there doesn't seem to be any test for this that can possibly added.
Current implementation :
def _copy_func_details(func, funcopy):
# we explicitly don't copy func.__dict__ into this copy as it would
# expose original attributes that should be mocked
for attribute in (
'__name__', '__doc__', '__text_signature__',
'__module__', '__defaults__', '__kwdefaults__',
):
try:
setattr(funcopy, attribute, getattr(func, attribute))
except AttributeError:
pass
Thanks |
|
Date |
User |
Action |
Args |
2018-10-11 10:18:20 | xtreak | set | recipients:
+ xtreak, berker.peksag, anthony-flury, cbelu |
2018-10-11 10:18:20 | xtreak | set | messageid: <1539253100.01.0.788709270274.issue32153@psf.upfronthosting.co.za> |
2018-10-11 10:18:20 | xtreak | link | issue32153 messages |
2018-10-11 10:18:19 | xtreak | create | |
|