[issue26750] Mock autospec does not work with subclasses of property()

2016-08-17 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- stage: commit review -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue26750] Mock autospec does not work with subclasses of property()

2016-08-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: inspect.isdatadescriptor() is better indeed. (I was initially working on an old version of mock.py which does not import inspect, and I did not want to add the dependency there). - inspect uses hasattr(type(obj)) instead of hasatr(obj). This is better, (b

[issue26750] Mock autospec does not work with subclasses of property()

2016-08-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3ff02380b1bf by Gregory P. Smith in branch '3.5': Issue #26750: use inspect.isdatadescriptor instead of our own https://hg.python.org/cpython/rev/3ff02380b1bf New changeset d51a66622266 by Gregory P. Smith in branch 'default': Issue #26750: use insp

[issue26750] Mock autospec does not work with subclasses of property()

2016-08-08 Thread Gregory P. Smith
Gregory P. Smith added the comment: Probably just Amaury and I forgetting that existed. Amaury, inspect.isdatadescriptor's implementation is a bit different than this change's _is_data_descriptor. Thoughts? -- stage: resolved -> commit review ___

[issue26750] Mock autospec does not work with subclasses of property()

2016-08-07 Thread Berker Peksag
Berker Peksag added the comment: Thanks! Is there a reason not to use inspect.isdatadescriptor() instead of _is_data_descriptor()? -- stage: commit review -> resolved ___ Python tracker ___

[issue26750] Mock autospec does not work with subclasses of property()

2016-08-07 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- resolution: -> fixed stage: patch review -> commit review status: open -> closed ___ Python tracker ___

[issue26750] Mock autospec does not work with subclasses of property()

2016-08-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset e947248100ae by Gregory P. Smith in branch '3.5': Issue #26750: unittest.mock.create_autospec() now works properly https://hg.python.org/cpython/rev/e947248100ae New changeset 0bc14c91ef7e by Gregory P. Smith in branch 'default': Issue #26750: unitt

[issue26750] Mock autospec does not work with subclasses of property()

2016-08-07 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue26750] Mock autospec does not work with subclasses of property()

2016-05-18 Thread Berker Peksag
Changes by Berker Peksag : -- assignee: -> berker.peksag ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue26750] Mock autospec does not work with subclasses of property()

2016-05-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Updated patch with review comments. -- Added file: http://bugs.python.org/file42891/mock-descriptor-2.patch ___ Python tracker ___ ___

[issue26750] Mock autospec does not work with subclasses of property()

2016-04-21 Thread Berker Peksag
Changes by Berker Peksag : -- components: +Library (Lib) -Tests nosy: +berker.peksag stage: -> patch review type: enhancement -> behavior versions: +Python 3.5, Python 3.6 ___ Python tracker __

[issue26750] Mock autospec does not work with subclasses of property()

2016-04-13 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc: When patching a class, mock.create_autospec() correctly detects properties and __slot__ attributes, but not subclasses of property() or other kinds of data descriptors. The attached patch detects all data descriptors and patch them the way they should