[New-bugs-announce] [issue26750] Mock autospec does not work with subclasses of property()

Amaury Forgeot d'Arc report at bugs.python.org
Wed Apr 13 18:13:06 EDT 2016


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 be.

----------
components: Tests
files: mock-descriptor.patch
keywords: patch
messages: 263361
nosy: amaury.forgeotdarc, michael.foord
priority: normal
severity: normal
status: open
title: Mock autospec does not work with subclasses of property()
type: enhancement
Added file: http://bugs.python.org/file42458/mock-descriptor.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26750>
_______________________________________


More information about the New-bugs-announce mailing list