Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Lib/unittest/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2748,7 +2748,7 @@ def _must_skip(spec, entry, is_type):
continue
if isinstance(result, (staticmethod, classmethod)):
return False
elif isinstance(getattr(result, '__get__', None), MethodWrapperTypes):
elif isinstance(result, FunctionTypes):
# Normal method => skip if looked up on type
# (if looked up on instance, self is already skipped)
return is_type
Expand Down Expand Up @@ -2778,10 +2778,6 @@ def __init__(self, spec, spec_set=False, parent=None,
type(ANY.__eq__),
)

MethodWrapperTypes = (
type(ANY.__eq__.__get__),
)


file_spec = None

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fix a bug in :func:`unittest.mock.create_autospec` that would complain about
the wrong number of arguments for custom descriptors defined in an extension
module returning functions.