From 324b58bf1824beae8f3d6891da525a7c98b72f80 Mon Sep 17 00:00:00 2001 From: Michael Foord Date: Wed, 28 Mar 2012 15:49:08 +0100 Subject: [PATCH] Update unittest.mock.patch example --- Doc/library/unittest.mock.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.40.0