mirror of https://github.com/python/cpython
Add import of `unittest.mock.Mock` in documentation (#102346)
This commit is contained in:
parent
7b9132057d
commit
cb944d0be8
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue