mirror of
https://github.com/python/cpython.git
synced 2025-10-07 15:42:02 +00:00
bpo-39966: Revert "bpo-25597: Ensure wraps' return value is used for magic methods in MagicMock" (GH-19734)
* Revert "bpo-25597: Ensure wraps' return value is used for magic methods in MagicMock (#16029)"
This reverts commit 72b1004657
.
This commit is contained in:
parent
d9a43e20fa
commit
521c8d6806
3 changed files with 12 additions and 12 deletions
|
@ -2012,12 +2012,6 @@ _side_effect_methods = {
|
|||
|
||||
|
||||
def _set_return_value(mock, method, name):
|
||||
# If _mock_wraps is present then attach it so that wrapped object
|
||||
# is used for return value is used when called.
|
||||
if mock._mock_wraps is not None:
|
||||
method._mock_wraps = getattr(mock._mock_wraps, name)
|
||||
return
|
||||
|
||||
fixed = _return_values.get(name, DEFAULT)
|
||||
if fixed is not DEFAULT:
|
||||
method.return_value = fixed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue