You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,10 +78,10 @@ also tracks function/method calls, return values and exceptions raised.
78
78
The object returned by ``mocker.spy`` is a ``MagicMock`` object, so all standard checking functions
79
79
are available (like ``assert_called_once_with`` or ``call_count`` in the examples above).
80
80
81
-
In addition, spy objects contain two extra attributes:
81
+
In addition, spy objects contain four extra attributes:
82
82
83
83
* ``spy_return``: contains the last returned value of the spied function.
84
-
* ``spy_return_iter``: contains a duplicate of the last returned value of the spied function if the value was an iterator. Uses `tee <https://docs.python.org/3/library/itertools.html#itertools.tee>`__) to duplicate the iterator.
84
+
* ``spy_return_iter``: contains a duplicate of the last returned value of the spied function if the value was an iterator and spy was created using ``.spy(..., duplicate_iterators)``. Uses `tee <https://docs.python.org/3/library/itertools.html#itertools.tee>`__) to duplicate the iterator.
85
85
* ``spy_return_list``: contains a list of all returned values of the spied function (new in ``3.13``).
86
86
* ``spy_exception``: contain the last exception value raised by the spied function/method when
87
87
it was last called, or ``None`` if no exception was raised.
0 commit comments