]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-75988: Fix issues with autospec ignoring wrapped object (#115223)
authorinfohash <46137868+infohash@users.noreply.github.com>
Fri, 8 Mar 2024 19:14:32 +0000 (00:44 +0530)
committerGitHub <noreply@github.com>
Fri, 8 Mar 2024 19:14:32 +0000 (19:14 +0000)
commit735fc2cbbcf875c359021b5b2af7f4c29f4cf66d
tree1dabd0f3ea328367d4f0864f9b7c2e6ee86ecd2c
parent7db871e4fa48eef20ea22414b226998f83facfd6
gh-75988: Fix issues with autospec ignoring wrapped object (#115223)

* set default return value of functional types as _mock_return_value

* added test of wrapping child attributes

* added backward compatibility with explicit return

* added docs on the order of precedence

* added test to check default return_value
Doc/library/unittest.mock.rst
Lib/test/test_unittest/testmock/testmock.py
Lib/unittest/mock.py
Misc/NEWS.d/next/Library/2024-02-27-13-05-51.gh-issue-75988.In6LlB.rst [new file with mode: 0644]