Commit 324b58bf authored by Michael Foord's avatar Michael Foord

Update unittest.mock.patch example

parent aa8ec7e0
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment