Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0682a0c

Browse files
committed
Minor docstring / docs corrections for unittest.mock
1 parent 656319e commit 0682a0c

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

Doc/library/unittest.mock-examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ by looking at the return value of the mocked class.
9999
In the example below we have a function `some_function` that instantiates `Foo`
100100
and calls a method on it. The call to `patch` replaces the class `Foo` with a
101101
mock. The `Foo` instance is the result of calling the mock, so it is configured
102-
by modify the mock :attr:`~Mock.return_value`.
102+
by modifying the mock :attr:`~Mock.return_value`.
103103

104104
>>> def some_function():
105105
... instance = module.Foo()

Doc/library/unittest.mock.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,10 @@ the `new_callable` argument to `patch`.
236236

237237
* `wraps`: Item for the mock object to wrap. If `wraps` is not None then
238238
calling the Mock will pass the call through to the wrapped object
239-
(returning the real result and ignoring `return_value`). Attribute access
240-
on the mock will return a Mock object that wraps the corresponding
241-
attribute of the wrapped object (so attempting to access an attribute
242-
that doesn't exist will raise an `AttributeError`).
239+
(returning the real result). Attribute access on the mock will return a
240+
Mock object that wraps the corresponding attribute of the wrapped
241+
object (so attempting to access an attribute that doesn't exist will
242+
raise an `AttributeError`).
243243

244244
If the mock has an explicit `return_value` set then calls are not passed
245245
to the wrapped object and the `return_value` is returned instead.

Lib/unittest/mock.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -941,12 +941,12 @@ class or instance) that acts as the specification for the mock object. If
941941
this is a new Mock (created on first access). See the
942942
`return_value` attribute.
943943
944-
* `wraps`: Item for the mock object to wrap. If `wraps` is not None
945-
then calling the Mock will pass the call through to the wrapped object
946-
(returning the real result and ignoring `return_value`). Attribute
947-
access on the mock will return a Mock object that wraps the corresponding
948-
attribute of the wrapped object (so attempting to access an attribute that
949-
doesn't exist will raise an `AttributeError`).
944+
* `wraps`: Item for the mock object to wrap. If `wraps` is not None then
945+
calling the Mock will pass the call through to the wrapped object
946+
(returning the real result). Attribute access on the mock will return a
947+
Mock object that wraps the corresponding attribute of the wrapped object
948+
(so attempting to access an attribute that doesn't exist will raise an
949+
`AttributeError`).
950950
951951
If the mock has an explicit `return_value` set then calls are not passed
952952
to the wrapped object and the `return_value` is returned instead.

0 commit comments

Comments
 (0)