https://github.com/python/cpython/commit/7ad463426c6a767e4b3c576528b76f842290951d commit: 7ad463426c6a767e4b3c576528b76f842290951d branch: 3.15 author: Miss Islington (bot) <[email protected]> committer: hugovk <[email protected]> date: 2026-09-05T15:53:40+01:00 summary:
[3.15] gh-156970: Set `Mock.return_value`'s docstring (GH-156971) (#156983) gh-156970: Set `Mock.return_value`'s docstring (GH-156971) (cherry picked from commit e620377918c8927d98533bbfcca894c7e5e78158) Co-authored-by: Ivy Xu <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]> files: A Misc/NEWS.d/next/Library/2026-09-05-15-27-11.gh-issue-156970.DxlgbB.rst M Lib/unittest/mock.py diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 8cf1e5411e91f71..aad4182f304475c 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -597,7 +597,7 @@ def __set_return_value(self, value): __return_value_doc = "The value to be returned when the mock is called." return_value = property(__get_return_value, __set_return_value, - __return_value_doc) + doc=__return_value_doc) @property diff --git a/Misc/NEWS.d/next/Library/2026-09-05-15-27-11.gh-issue-156970.DxlgbB.rst b/Misc/NEWS.d/next/Library/2026-09-05-15-27-11.gh-issue-156970.DxlgbB.rst new file mode 100644 index 000000000000000..dd60841efe821c2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-09-05-15-27-11.gh-issue-156970.DxlgbB.rst @@ -0,0 +1 @@ +Set the docstring of :attr:`unittest.mock.Mock.return_value`. _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
