]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-75988: Fix issues with autospec ignoring wrapped object (GH-115223) (#117124)
authorinfohash <46137868+infohash@users.noreply.github.com>
Fri, 22 Mar 2024 09:48:41 +0000 (15:18 +0530)
committerGitHub <noreply@github.com>
Fri, 22 Mar 2024 09:48:41 +0000 (09:48 +0000)
commit51da1ddefc74354cfb353db7f61ea7bb6298b332
tree4429b5d2694686a1c2e90abbef45ec88272e8154
parent0ec856157408c84f6a794b8fa0718d2c05b1fe08
[3.11] gh-75988: Fix issues with autospec ignoring wrapped object (GH-115223) (#117124)

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

(cherry picked from commit 735fc2cbbcf875c359021b5b2af7f4c29f4cf66d)
Doc/library/unittest.mock.rst
Lib/unittest/mock.py
Lib/unittest/test/testmock/testmock.py
Misc/NEWS.d/next/Library/2024-02-27-13-05-51.gh-issue-75988.In6LlB.rst [new file with mode: 0644]