Skip to content

[3.12] Link to the glossary for "magic methods" in MagicMock (GH-111292) #114002

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 1 commit into from
Jan 12, 2024
Merged
Changes from all commits
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
8 changes: 4 additions & 4 deletions Doc/library/unittest.mock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1960,8 +1960,8 @@ Mocking Magic Methods
~~~~~~~~~~~~~~~~~~~~~

:class:`Mock` supports mocking the Python protocol methods, also known as
"magic methods". This allows mock objects to replace containers or other
objects that implement Python protocols.
:term:`"magic methods" <magic method>`. This allows mock objects to replace
containers or other objects that implement Python protocols.

Because magic methods are looked up differently from normal methods [#]_, this
support has been specially implemented. This means that only specific magic
Expand Down Expand Up @@ -2059,8 +2059,8 @@ There are two ``MagicMock`` variants: :class:`MagicMock` and :class:`NonCallable
.. class:: MagicMock(*args, **kw)

``MagicMock`` is a subclass of :class:`Mock` with default implementations
of most of the magic methods. You can use ``MagicMock`` without having to
configure the magic methods yourself.
of most of the :term:`magic methods <magic method>`. You can use
``MagicMock`` without having to configure the magic methods yourself.

The constructor parameters have the same meaning as for :class:`Mock`.

Expand Down