]> granicus.if.org Git - python/commitdiff
Minor docstring / docs corrections for unittest.mock
authorMichael Foord <michael@voidspace.org.uk>
Fri, 13 Apr 2012 19:51:20 +0000 (20:51 +0100)
committerMichael Foord <michael@voidspace.org.uk>
Fri, 13 Apr 2012 19:51:20 +0000 (20:51 +0100)
Doc/library/unittest.mock-examples.rst
Doc/library/unittest.mock.rst
Lib/unittest/mock.py

index d220bb34eadb26c7b6db63309ac206b9ed82823f..0fc32d2077b4c02c4fd19f740c5dd0482df28faf 100644 (file)
@@ -99,7 +99,7 @@ by looking at the return value of the mocked class.
 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()
index f00d29f028e8b11efcd3f74d1178d19014a27815..ed6775a4878e97817f0ab0be2f8204bd5e26cd78 100644 (file)
@@ -236,10 +236,10 @@ the `new_callable` argument to `patch`.
 
     * `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.
index 04eba918cc4f9463013633097d3f063849cf7369..8cedcb4e718012fefdff5b68df7aace2c2560082 100644 (file)
@@ -941,12 +941,12 @@ class Mock(CallableMixin, NonCallableMock):
       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.