From: Michael Foord Date: Wed, 28 Mar 2012 14:49:08 +0000 (+0100) Subject: Update unittest.mock.patch example X-Git-Tag: v3.3.0a2~30^2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=324b58bf1824beae8f3d6891da525a7c98b72f80;p=python Update unittest.mock.patch example --- diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index 153dcab3b6..8bb37dc7a3 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -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