8000 gh-124234: Improve docs for `Mock.reset_mock` by sobolevn · Pull Request #124237 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-124234: Improve docs for Mock.reset_mock #124237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Conversation

sobolevn
Copy link
Member
@sobolevn sobolevn commented Sep 19, 2024

@cjw296 I don't think we ever set type annotations to the method signatures in docs. We only communicate this with the text itself.

So, I added two doctest examples that show how to use these parameters.


📚 Documentation preview 📚: https://cpython-previews--124237.org.readthedocs.build/

@cjw296
Copy link
Contributor
cjw296 commented Sep 19, 2024

Oh, I meant adding a type annotation in the code in mock.py, I don't know why we don't do more of this in the stdlib?

Copy link
Contributor
@cjw296 cjw296 left a comment

Choose a reason for hiding this comment

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

Looks good!

@sobolevn
Copy link
Member Author

@cjw296 oh, sure! I can do this as well. Simple : bool annotation won't hurt, I guess :)

@sobolevn
Copy link
Member Author

Done! 👍

@sobolevn sobolevn requested a review from cjw296 September 24, 2024 07:06
Copy link
Contributor
@cjw296 cjw296 left a comment

Choose a reason for hiding this comment

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

You may know, but I do not: are the doctest examples, such as those you've added, actually executed by CPython CI?

@sobolevn
Copy link
Member Author

are the doctest examples, such as those you've added, actually executed by CPython CI?

Yes, they are. We have a special Doctest job that does that.
See https://github.com/python/cpython/actions/runs/10954436653/job/30416486376?pr=124237#step:8:372

We have 465 tests in mock.rst docs :)

@sobolevn sobolevn merged commit 19fed6c into python:main Sep 26, 2024
34 checks passed
@miss-islington-app
Copy link

Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@miss-islington-app
Copy link

Sorry, @sobolevn, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 19fed6cf6eb51044fd0c02c6338259e2dd7fd462 3.13

@sobolevn
Copy link
Member Author

Thank you for your reviews and help 🤝

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 26, 2024
(cherry picked from commit 19fed6c)

Co-authored-by: sobolevn <mail@sobolevn.me>
@bedevere-app
Copy link
bedevere-app bot commented Sep 26, 2024

GH-124592 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Sep 26, 2024
@sobolevn
Copy link
Member Author

We need to first merge #124231 to backport this change to 3.13

sobolevn added a commit that referenced this pull request Sep 26, 2024
…4592)

gh-124234: Improve docs for `Mock.reset_mock` (GH-124237)
(cherry picked from commit 19fed6c)

Co-authored-by: sobolevn <mail@sobolevn.me>
@hugovk hugovk removed the needs backport to 3.13 bugs and security fixes label Feb 21, 2025
@hugovk hugovk added the needs backport to 3.13 bugs and security fixes label Feb 21, 2025
@miss-islington-app
Copy link

Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 21, 2025
(cherry picked from commit 19fed6c)

Co-authored-by: sobolevn <mail@sobolevn.me>
@bedevere-app
Copy link
bedevere-app bot commented Feb 21, 2025

GH-130408 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 Feb 21, 2025
hugovk pushed a commit that referenced this pull request Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0