diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2013-03-30 15:29:54 (GMT) |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-03-30 15:29:54 (GMT) |
| commit | 9498839a1a29205d65c798a3a6bca272430b83c1 (patch) | |
| tree | c4d19e95481f2d72fb86584eabf5c1cb925f8a40 /Doc/library/unittest.mock-examples.rst | |
| parent | 912fbff1053c7ebadced3233b18fb951e6d15399 (diff) | |
| parent | 3fdd4f1935ba1bb4b45d77ed99281b134f3e6d24 (diff) | |
| download | cpython-9498839a1a29205d65c798a3a6bca272430b83c1.zip cpython-9498839a1a29205d65c798a3a6bca272430b83c1.tar.gz cpython-9498839a1a29205d65c798a3a6bca272430b83c1.tar.bz2 | |
Merge
Diffstat (limited to 'Doc/library/unittest.mock-examples.rst')
| -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') |
