Update unittest.mock.patch example

This commit is contained in:
Michael Foord 2012-03-28 15:49:08 +01:00
parent aa8ec7e076
commit 324b58bf18

View file

@ -988,10 +988,10 @@ patch
the decorated function:
>>> @patch('__main__.SomeClass')
... def function(mock_class):
... def function(normal_argument, mock_class):
... print(mock_class is SomeClass)
...
>>> function()
>>> function(None)
True
Patching a class replaces the class with a `MagicMock` *instance*. If the