diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-01-21 05:01:51 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-01-21 05:01:51 (GMT) |
commit | 30ffe7eb68015233a587153dcaa931b0bece59cc (patch) | |
tree | 172318a219a0dd8e3f73eb2e53fa96d92140b24f | |
parent | 39d798eb03e2f389b9d59d005a14eed1467f18cd (diff) | |
download | cpython-30ffe7eb68015233a587153dcaa931b0bece59cc.zip cpython-30ffe7eb68015233a587153dcaa931b0bece59cc.tar.gz cpython-30ffe7eb68015233a587153dcaa931b0bece59cc.tar.bz2 |
Issue #20222: file is no longer a builtin in 3.x.
-rw-r--r-- | Doc/library/unittest.mock-examples.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst index d7d697d..49406d0 100644 --- a/Doc/library/unittest.mock-examples.rst +++ b/Doc/library/unittest.mock-examples.rst @@ -462,7 +462,7 @@ the `backend` attribute on a `Something` instance. In this particular case we are only interested in the return value from the final call to `start_call` so we don't have much configuration to do. Let's assume the object it returns is 'file-like', so we'll ensure that our response object -uses the builtin `file` as its `spec`. +uses the builtin `open` as its `spec`. To do this we create a mock instance as our mock backend and create a mock response object for it. To set the response as the return value for that final @@ -474,7 +474,7 @@ We can do that in a slightly nicer way using the :meth:`~Mock.configure_mock` method to directly set the return value for us: >>> something = Something() - >>> mock_response = Mock(spec=file) + >>> mock_response = Mock(spec=open) >>> mock_backend = Mock() >>> config = {'get_endpoint.return_value.create_call.return_value.start_call.return_value': mock_response} >>> mock_backend.configure_mock(**config) |