[issue24856] Mock.side_effect as iterable or iterator

2015-08-13 Thread Martijn Pieters
New submission from Martijn Pieters: The documentation states that `side_effect` can be set to an [iterable](https://docs.python.org/3/glossary.html#term-iterable): If you pass in an iterable, it is used to retrieve an iterator which must yield a value on every call. This value can either

[issue24856] Mock.side_effect as iterable or iterator

2015-08-13 Thread R. David Murray
R. David Murray added the comment: The documentation is accurate. The object being manipulated by the code clause you site is not the original object passed in to the side_effect argument. -- nosy: +r.david.murray resolution: - not a bug stage: - resolved status: open - closed

[issue24856] Mock.side_effect as iterable or iterator

2015-08-13 Thread Martijn Pieters
Martijn Pieters added the comment: Bugger, that's the last time I take someone's word for it and not test properly. Indeed, I missed the inheritance of NonCallableMock, so the property is inherited from there. Mea Culpa! -- ___ Python tracker