Skip to content
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

Added reference for return_value in unittest.mock documentation #119207

Merged
merged 2 commits into from
May 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/unittest.mock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ the *new_callable* argument to :func:`patch`.
parameter as ``True``. Child mocks and the return value mock
(if any) are reset as well.

.. note:: *return_value*, and :attr:`side_effect` are keyword-only
.. note:: :attr:`return_value`, and :attr:`side_effect` are keyword-only
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! Attention to detail, increases consistency.

Copy link
Contributor

Choose a reason for hiding this comment

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

@encukou , LMK if I need to look for anything else.

Copy link
Member

Choose a reason for hiding this comment

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

Both of these refer to the function arguments, so they should be marked up as such (*return_value* and *side_effect*).

But, a bit above in:

 In case you want to reset *return_value* or :attr:`side_effect`

these refer to attributes of the Mock objects, and should use :attr: (return_value should be changed to use :attr:).

arguments.


Expand Down
Loading