gh-124234: Improve docs for Mock.reset_mock#124237
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? |
|
@cjw296 oh, sure! I can do this as well. Simple |
|
Done! 👍 |
cjw296
left a comment
There was a problem hiding this comment.
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_mockdocs: clarify thatreturn_valueandside_effectsare booleans #124234📚 Documentation preview 📚: https://cpython-previews--124237.org.readthedocs.build/