Skip to content

Commit ac613d0

Browse files
committed
Change the request.Request example method
has_data is used in the explanation of mock autospeccing. This method of request.Request was removed in version 3.4.
1 parent af5799f commit ac613d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/unittest.mock.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,9 +2654,9 @@ with any methods on the mock:
26542654

26552655
.. code-block:: pycon
26562656
2657-
>>> mock.has_data()
2657+
>>> mock.header_items()
26582658
<mock.Mock object at 0x...>
2659-
>>> mock.has_data.assret_called_with() # Intentional typo!
2659+
>>> mock.header_items.assret_called_with() # Intentional typo!
26602660
26612661
Auto-speccing solves this problem. You can either pass ``autospec=True`` to
26622662
:func:`patch` / :func:`patch.object` or use the :func:`create_autospec` function to create a

0 commit comments

Comments
 (0)