From: Wagner Alberto Date: Fri, 3 Mar 2023 17:25:31 +0000 (-0300) Subject: Add import of `unittest.mock.Mock` in documentation (#102346) X-Git-Tag: v3.12.0a6~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb944d0be869dfb1189265467ec8a986176cc104;p=thirdparty%2FPython%2Fcpython.git Add import of `unittest.mock.Mock` in documentation (#102346) --- diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index d6d8e5e9557d..6c4d801f69f5 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -72,6 +72,7 @@ available, and then make assertions about how they have been used: :attr:`side_effect` allows you to perform side effects, including raising an exception when a mock is called: + >>> from unittest.mock import Mock >>> mock = Mock(side_effect=KeyError('foo')) >>> mock() Traceback (most recent call last):