Message328649
iter is initialized by using side_effects, not return_value.
The statement "According to the documentation .return_value should be identical to the object returned when calling the mock" works only when it return_value has been used to define the behaviour of the mock.
Example:
```
>>> m = MagicMock(side_effect=lambda: 1)
>>> m()
1
>>> m.return_value
<MagicMock name='mock()' id='140107830678472'>
>>> m() is m.return_value
False
``` |
|
Date |
User |
Action |
Args |
2018-10-27 13:52:14 | mariocj89 | set | recipients:
+ mariocj89, michael.foord, mrh1997, xtreak |
2018-10-27 13:52:14 | mariocj89 | set | messageid: <1540648334.82.0.788709270274.issue33236@psf.upfronthosting.co.za> |
2018-10-27 13:52:14 | mariocj89 | link | issue33236 messages |
2018-10-27 13:52:14 | mariocj89 | create | |
|