diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-03-30 03:56:21 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-03-30 03:56:21 (GMT) |
commit | 9d672384399e7bde8c058c64f85f3a2d5dfe20ac (patch) | |
tree | 3ab15a77aa7292363d11f9e6567ce976f9fabd7f | |
parent | 0503de9c83b3fb3545d8fe34ad560ec3fc56a63b (diff) | |
parent | b40a2203adff6511afc65fe885816636e135c935 (diff) | |
download | cpython-9d672384399e7bde8c058c64f85f3a2d5dfe20ac.zip cpython-9d672384399e7bde8c058c64f85f3a2d5dfe20ac.tar.gz cpython-9d672384399e7bde8c058c64f85f3a2d5dfe20ac.tar.bz2 |
#17539: merge with 3.3.
-rw-r--r-- | Doc/library/unittest.mock-examples.rst | 6 |
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') |