diff options
author | Wagner Alberto <wagneralbjr@gmail.com> | 2023-03-03 17:25:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-03 17:25:31 (GMT) |
commit | cb944d0be869dfb1189265467ec8a986176cc104 (patch) | |
tree | 614bc0fc41b755437e8e3b8ef08788aed59955f3 /Doc/library/unittest.mock.rst | |
parent | 7b9132057d8f176cb9c40e8324f5122a3132ee58 (diff) | |
download | cpython-cb944d0be869dfb1189265467ec8a986176cc104.zip cpython-cb944d0be869dfb1189265467ec8a986176cc104.tar.gz cpython-cb944d0be869dfb1189265467ec8a986176cc104.tar.bz2 |
Add import of `unittest.mock.Mock` in documentation (#102346)
Diffstat (limited to 'Doc/library/unittest.mock.rst')
-rw-r--r-- | Doc/library/unittest.mock.rst | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index d6d8e5e..6c4d801 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): |