[Python-checkins] cpython: Minor docstring / docs corrections for unittest.mock
michael.foord
python-checkins at python.org
Fri Apr 13 21:51:36 CEST 2012
http://hg.python.org/cpython/rev/9db3bedcd86c
changeset: 76289:9db3bedcd86c
user: Michael Foord <michael at voidspace.org.uk>
date: Fri Apr 13 20:51:20 2012 +0100
summary:
Minor docstring / docs corrections for unittest.mock
files:
Doc/library/unittest.mock-examples.rst | 2 +-
Doc/library/unittest.mock.rst | 8 ++++----
Lib/unittest/mock.py | 12 ++++++------
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst
--- a/Doc/library/unittest.mock-examples.rst
+++ b/Doc/library/unittest.mock-examples.rst
@@ -99,7 +99,7 @@
In the example below we have a function `some_function` that instantiates `Foo`
and calls a method on it. The call to `patch` replaces the class `Foo` with a
mock. The `Foo` instance is the result of calling the mock, so it is configured
-by modify the mock :attr:`~Mock.return_value`.
+by modifying the mock :attr:`~Mock.return_value`.
>>> def some_function():
... instance = module.Foo()
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst
--- a/Doc/library/unittest.mock.rst
+++ b/Doc/library/unittest.mock.rst
@@ -236,10 +236,10 @@
* `wraps`: Item for the mock object to wrap. If `wraps` is not None then
calling the Mock will pass the call through to the wrapped object
- (returning the real result and ignoring `return_value`). Attribute access
- on the mock will return a Mock object that wraps the corresponding
- attribute of the wrapped object (so attempting to access an attribute
- that doesn't exist will raise an `AttributeError`).
+ (returning the real result). Attribute access on the mock will return a
+ Mock object that wraps the corresponding attribute of the wrapped
+ object (so attempting to access an attribute that doesn't exist will
+ raise an `AttributeError`).
If the mock has an explicit `return_value` set then calls are not passed
to the wrapped object and the `return_value` is returned instead.
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -941,12 +941,12 @@
this is a new Mock (created on first access). See the
`return_value` attribute.
- * `wraps`: Item for the mock object to wrap. If `wraps` is not None
- then calling the Mock will pass the call through to the wrapped object
- (returning the real result and ignoring `return_value`). Attribute
- access on the mock will return a Mock object that wraps the corresponding
- attribute of the wrapped object (so attempting to access an attribute that
- doesn't exist will raise an `AttributeError`).
+ * `wraps`: Item for the mock object to wrap. If `wraps` is not None then
+ calling the Mock will pass the call through to the wrapped object
+ (returning the real result). Attribute access on the mock will return a
+ Mock object that wraps the corresponding attribute of the wrapped object
+ (so attempting to access an attribute that doesn't exist will raise an
+ `AttributeError`).
If the mock has an explicit `return_value` set then calls are not passed
to the wrapped object and the `return_value` is returned instead.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list