summaryrefslogtreecommitdiffstats
path: root/Doc/library/unittest.mock-examples.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/unittest.mock-examples.rst')
-rw-r--r--Doc/library/unittest.mock-examples.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst
index f32a282..444c208 100644
--- a/Doc/library/unittest.mock-examples.rst
+++ b/Doc/library/unittest.mock-examples.rst
@@ -338,11 +338,11 @@ with.
...
>>> test()
-If you are patching a module (including `__builtin__`) then use `patch`
+If you are patching a module (including :mod:`builtins`) then use `patch`
instead of `patch.object`:
- >>> mock = MagicMock(return_value = sentinel.file_handle)
- >>> with patch('__builtin__.open', mock):
+ >>> mock = MagicMock(return_value=sentinel.file_handle)
+ >>> with patch('builtins.open', mock):
... handle = open('filename', 'r')
...
>>> mock.assert_called_with('filename', 'r')