mirror of
https://github.com/python/cpython.git
synced 2025-11-13 07:26:31 +00:00
Close #20759: Fix some typos in the mock docs. (Merge with 3.3)
This commit is contained in:
commit
984689821d
2 changed files with 3 additions and 3 deletions
|
|
@ -426,7 +426,7 @@ mock using the "as" form of the with statement:
|
||||||
|
|
||||||
As an alternative `patch`, `patch.object` and `patch.dict` can be used as
|
As an alternative `patch`, `patch.object` and `patch.dict` can be used as
|
||||||
class decorators. When used in this way it is the same as applying the
|
class decorators. When used in this way it is the same as applying the
|
||||||
decorator indvidually to every method whose name starts with "test".
|
decorator individually to every method whose name starts with "test".
|
||||||
|
|
||||||
|
|
||||||
.. _further-examples:
|
.. _further-examples:
|
||||||
|
|
|
||||||
|
|
@ -958,7 +958,7 @@ method:
|
||||||
|
|
||||||
.. [#] The only exceptions are magic methods and attributes (those that have
|
.. [#] The only exceptions are magic methods and attributes (those that have
|
||||||
leading and trailing double underscores). Mock doesn't create these but
|
leading and trailing double underscores). Mock doesn't create these but
|
||||||
instead of raises an ``AttributeError``. This is because the interpreter
|
instead raises an ``AttributeError``. This is because the interpreter
|
||||||
will often implicitly request these methods, and gets *very* confused to
|
will often implicitly request these methods, and gets *very* confused to
|
||||||
get a new Mock object when it expects a magic method. If you need magic
|
get a new Mock object when it expects a magic method. If you need magic
|
||||||
method support see :ref:`magic methods <magic-methods>`.
|
method support see :ref:`magic methods <magic-methods>`.
|
||||||
|
|
@ -1509,7 +1509,7 @@ Patching Descriptors and Proxy Objects
|
||||||
Both patch_ and patch.object_ correctly patch and restore descriptors: class
|
Both patch_ and patch.object_ correctly patch and restore descriptors: class
|
||||||
methods, static methods and properties. You should patch these on the *class*
|
methods, static methods and properties. You should patch these on the *class*
|
||||||
rather than an instance. They also work with *some* objects
|
rather than an instance. They also work with *some* objects
|
||||||
that proxy attribute access, like the `django setttings object
|
that proxy attribute access, like the `django settings object
|
||||||
<http://www.voidspace.org.uk/python/weblog/arch_d7_2010_12_04.shtml#e1198>`_.
|
<http://www.voidspace.org.uk/python/weblog/arch_d7_2010_12_04.shtml#e1198>`_.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue