Skip to content

Commit 54d4154

Browse files
pieqqGlyphack
authored andcommitted
Link to the glossary for "magic methods" in MagicMock (python#111292)
The MagicMock documentation mentions magic methods several times without actually pointing to the term in the glossary. This can be helpful for people to fully understand what those magic methods are.
1 parent 96c4ae4 commit 54d4154

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Doc/library/unittest.mock.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,8 +2009,8 @@ Mocking Magic Methods
20092009
~~~~~~~~~~~~~~~~~~~~~
20102010

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

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

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

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

0 commit comments

Comments
 (0)