]> granicus.if.org Git - python/commitdiff
Update unittest.mock.patch example
authorMichael Foord <michael@voidspace.org.uk>
Wed, 28 Mar 2012 14:49:08 +0000 (15:49 +0100)
committerMichael Foord <michael@voidspace.org.uk>
Wed, 28 Mar 2012 14:49:08 +0000 (15:49 +0100)
Doc/library/unittest.mock.rst

index 153dcab3b6e77acbdde30c27712db81d85cb24d0..8bb37dc7a31ffa542aaef1b11feb5540d76b5b2b 100644 (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