mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Adding patch.stopall method to unittest.mock
This commit is contained in:
parent
bfcb42936b
commit
f7c4158057
3 changed files with 44 additions and 4 deletions
|
@ -1354,8 +1354,12 @@ method of a `TestCase`:
|
|||
As an added bonus you no longer need to keep a reference to the `patcher`
|
||||
object.
|
||||
|
||||
In fact `start` and `stop` are just aliases for the context manager
|
||||
`__enter__` and `__exit__` methods.
|
||||
It is also possible to stop all patches which have been started by using
|
||||
`patch.stopall`.
|
||||
|
||||
.. function:: patch.stopall
|
||||
|
||||
Stop all active patches.
|
||||
|
||||
|
||||
TEST_PREFIX
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue