mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
gh-91803: Mock - fix error when using autospec methods with seal (#92213)
Fixes https://github.com/python/cpython/issues/91803. Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com> Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
parent
728e42fcf5
commit
c6325b1c9f
3 changed files with 8 additions and 1 deletions
|
|
@ -2745,6 +2745,7 @@ def create_autospec(spec, spec_set=False, instance=False, _parent=None,
|
|||
_new_parent=parent,
|
||||
**kwargs)
|
||||
mock._mock_children[entry] = new
|
||||
new.return_value = child_klass()
|
||||
_check_signature(original, new, skipfirst=skipfirst)
|
||||
|
||||
# so functions created with _set_signature become instance attributes,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue