Skip to content

gh-156970: Set the docstring of Mock.return_value correctly - #156971

Merged
StanFromIreland merged 3 commits into
python:mainfrom
ByteFlowing1337:fix-156970
Sep 5, 2026
Merged

gh-156970: Set the docstring of Mock.return_value correctly#156971
StanFromIreland merged 3 commits into
python:mainfrom
ByteFlowing1337:fix-156970

Conversation

@ByteFlowing1337

@ByteFlowing1337 ByteFlowing1337 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

@ByteFlowing1337 ByteFlowing1337 changed the title gh-156970: Set the docstring of Mock.return_value correctly. gh-156970: Set the docstring of Mock.return_value correctly Sep 5, 2026

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one little nit.

Comment thread Misc/NEWS.d/next/Library/2026-09-05-15-27-11.gh-issue-156970.DxlgbB.rst Outdated
Co-authored-by: Stan Ulbrych <stan@python.org>
@StanFromIreland
StanFromIreland merged commit e620377 into python:main Sep 5, 2026
51 checks passed
@StanFromIreland

Copy link
Copy Markdown
Member

Since this is technically a new feature, I'm not going to backport.

@StanFromIreland

Copy link
Copy Markdown
Member

Although thinking about it further, I will, because it's currently passed as fdel (technically, deletion is intercepted by NonCallableMock.__delattr__ and never reaches it. So in practice you won't hit the TypeError.).

@StanFromIreland StanFromIreland added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Sep 5, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @ByteFlowing1337 for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @ByteFlowing1337 for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @ByteFlowing1337 for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@bedevere-app

bedevere-app Bot commented Sep 5, 2026

Copy link
Copy Markdown

GH-156981 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Sep 5, 2026
@bedevere-app

bedevere-app Bot commented Sep 5, 2026

Copy link
Copy Markdown

GH-156982 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Sep 5, 2026
@bedevere-app

bedevere-app Bot commented Sep 5, 2026

Copy link
Copy Markdown

GH-156983 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Sep 5, 2026
StanFromIreland added a commit that referenced this pull request Sep 5, 2026
…56981)

(cherry picked from commit e620377)

Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
StanFromIreland added a commit that referenced this pull request Sep 5, 2026
…56982)

(cherry picked from commit e620377)

Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
hugovk pushed a commit that referenced this pull request Sep 5, 2026
…56983)

gh-156970: Set `Mock.return_value`'s docstring (GH-156971)
(cherry picked from commit e620377)

Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
@ByteFlowing1337
ByteFlowing1337 deleted the fix-156970 branch September 6, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants