summaryrefslogtreecommitdiffstats
path: root/Doc/library/unittest.mock.rst
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-10-13 20:12:09 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-10-13 20:12:09 (GMT)
commit98b28fddd8e63e1a9410facee3e41925eed8ac46 (patch)
tree410d277cbb20078d5fd226e8dd4d24bd225237d8 /Doc/library/unittest.mock.rst
parent6039db8de30b5c20ba864cc4127fbfabf6fc0641 (diff)
parentbfdcd436f0410e2b3eb34ce4fd7411488d3f13fb (diff)
downloadcpython-98b28fddd8e63e1a9410facee3e41925eed8ac46.zip
cpython-98b28fddd8e63e1a9410facee3e41925eed8ac46.tar.gz
cpython-98b28fddd8e63e1a9410facee3e41925eed8ac46.tar.bz2
Issue #18758: Fixed and improved cross-references.
Diffstat (limited to 'Doc/library/unittest.mock.rst')
-rw-r--r--Doc/library/unittest.mock.rst7
1 files changed, 4 insertions, 3 deletions
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst
index 4a7d647..d7efcf4 100644
--- a/Doc/library/unittest.mock.rst
+++ b/Doc/library/unittest.mock.rst
@@ -210,8 +210,8 @@ the `new_callable` argument to `patch`.
Accessing any attribute not in this list will raise an `AttributeError`.
If `spec` is an object (rather than a list of strings) then
- :attr:`__class__` returns the class of the spec object. This allows mocks
- to pass `isinstance` tests.
+ :attr:`~instance.__class__` returns the class of the spec object. This
+ allows mocks to pass `isinstance` tests.
* `spec_set`: A stricter variant of `spec`. If used, attempting to *set*
or get an attribute on the mock that isn't on the object passed as
@@ -1989,7 +1989,8 @@ mock_open
default) then a `MagicMock` will be created for you, with the API limited
to methods or attributes available on standard file handles.
- `read_data` is a string for the `read`, `readline`, and `readlines` methods
+ `read_data` is a string for the :meth:`~io.IOBase.read`,
+ :meth:`~io.IOBase.readline`, and :meth:`~io.IOBase.readlines` methods
of the file handle to return. Calls to those methods will take data from
`read_data` until it is depleted. The mock of these methods is pretty
simplistic. If you need more control over the data that you are feeding to