-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
Conversation
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
@cjw296 oh, sure! I can do this as well. Simple |
Done! 👍 |
There was a problem hiding this 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?
Yes, they are. We have a special We have 465 tests in |
Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
Sorry, @sobolevn, I could not cleanly backport this to
|
Thank you for your reviews and help 🤝 |
(cherry picked from commit 19fed6c) Co-authored-by: sobolevn <mail@sobolevn.me>
GH-124592 is a backport of this pull request to the 3.12 branch. |
We need to first merge #124231 to backport this change to 3.13 |
Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
(cherry picked from commit 19fed6c) Co-authored-by: sobolevn <mail@sobolevn.me>
GH-130408 is a backport of this pull request to the 3.13 branch. |
…0408) Co-authored-by: sobolevn <mail@sobolevn.me>
@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.
mock.reset_mock
docs: clarify thatreturn_value
andside_effects
are booleans #124234📚 Documentation preview 📚: https://cpython-previews--124237.org.readthedocs.build/