Staging
v0.8.1
v0.8.1
https://github.com/python/cpython
Revision 12b9fb603eea9298c835bae5b8742db4fa52892e authored by Miss Islington (bot) on 08 December 2018, 11:41:52 UTC, committed by Chris Withers on 08 December 2018, 11:41:52 UTC
* tests: Further validate `wraps` functionality in `unittest.mock.Mock` Add more tests to validate how `wraps` interacts with other features of mocks. * Don't call the wrapped object if `side_effect` is set When a object is wrapped using `Mock(wraps=...)`, if an user sets a `side_effect` in one of their methods, return the value of `side_effect` and don't call the original object. * Refactor what to be called on `mock_call` When a `Mock` is called, it should return looking up in the following order: `side_effect`, `return_value`, `wraps`. If any of the first two return `mock.DEFAULT`, lookup in the next option. It makes no sense to check for `wraps` returning default, as it is supposed to be the original implementation and there is nothing to fallback to. (cherry picked from commit f05df0a4b679d0acfd0b1fe6187ba2d553b37afa) Co-authored-by: Mario Corchero <mariocj89@gmail.com>
1 parent 2d6bc25
Tip revision: 12b9fb603eea9298c835bae5b8742db4fa52892e authored by Miss Islington (bot) on 08 December 2018, 11:41:52 UTC
bpo-35330: Don't call the wrapped object if `side_effect` is set (GH11034)
bpo-35330: Don't call the wrapped object if `side_effect` is set (GH11034)
Tip revision: 12b9fb6
File | Mode | Size |
---|---|---|
c-api | ||
data | ||
distributing | ||
distutils | ||
extending | ||
faq | ||
howto | ||
includes | ||
install | ||
installing | ||
library | ||
reference | ||
tools | ||
tutorial | ||
using | ||
whatsnew | ||
Makefile | -rw-r--r-- | 7.3 KB |
README.rst | -rw-r--r-- | 4.3 KB |
about.rst | -rw-r--r-- | 1.5 KB |
bugs.rst | -rw-r--r-- | 4.2 KB |
conf.py | -rw-r--r-- | 6.1 KB |
contents.rst | -rw-r--r-- | 538 bytes |
copyright.rst | -rw-r--r-- | 451 bytes |
docutils.conf | -rw-r--r-- | 56 bytes |
glossary.rst | -rw-r--r-- | 51.2 KB |
license.rst | -rw-r--r-- | 46.2 KB |
make.bat | -rw-r--r-- | 5.2 KB |
Computing file changes ...