Skip to content
Draft
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: 1 addition & 7 deletions Doc/library/unittest.mock-examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ Mocking a generator method
~~~~~~~~~~~~~~~~~~~~~~~~~~

A Python generator is a function or method that uses the :keyword:`yield` statement
to return a series of values when iterated over [#]_.
to return a series of values when iterated over.

A generator method / function is called to return the generator object. It is
the generator object that is then iterated over. The protocol method for
Expand Down Expand Up @@ -671,12 +671,6 @@ To configure the values returned from the iteration (implicit in the call to
>>> list(mock_foo.iter())
[1, 2, 3]

.. [#] There are also generator expressions and more `advanced uses
<http://www.dabeaz.com/coroutines/index.html>`_ of generators, but we aren't
concerned about them here. A very good introduction to generators and how
powerful they are is: `Generator Tricks for Systems Programmers
<http://www.dabeaz.com/generators/>`_.


Applying the same patch to every test method
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
Loading