mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-38473: Handle autospecced functions and methods used with attach_mock (GH-16784)
This commit is contained in:
parent
b8d1262e8a
commit
66b00a9d3a
3 changed files with 35 additions and 0 deletions
|
@ -817,6 +817,10 @@ class NonCallableMock(Base):
|
|||
if child is None or isinstance(child, _SpecState):
|
||||
break
|
||||
else:
|
||||
# If an autospecced object is attached using attach_mock the
|
||||
# child would be a function with mock object as attribute from
|
||||
# which signature has to be derived.
|
||||
child = _extract_mock(child)
|
||||
children = child._mock_children
|
||||
sig = child._spec_signature
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue