Message328649
| Author | mariocj89 |
|---|---|
| Recipients | mariocj89, michael.foord, mrh1997, xtreak |
| Date | 2018-10-27.13:52:14 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1540648334.82.0.788709270274.issue33236@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
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 ``` |
|
| History | |||
|---|---|---|---|
| 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 | |