https://github.com/python/cpython/commit/0da9c271a835b7f1a3c971df23d267433ea42f54
commit: 0da9c271a835b7f1a3c971df23d267433ea42f54
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: StanFromIreland <[email protected]>
date: 2026-09-05T14:34:22Z
summary:

[3.13] gh-156970: Set `Mock.return_value`'s docstring (GH-156971) (#156981)

(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 84f629ee1f76ac8..6fd053636b0221f 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -590,7 +590,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]

Reply via email to