[issue36598] mock side_effect should be checked for iterable not callable

2019-04-11 Thread Gregory Ronin
Gregory Ronin added the comment: You are right. I was not calling generator the right way in mock. After I tried your suggestion it works. -- ___ Python tracker <https://bugs.python.org/issue36

[issue36598] mock side_effect should be checked for iterable not callable

2019-04-10 Thread Gregory Ronin
New submission from Gregory Ronin : In mock.py, in method: def _mock_call(_mock_self, *args, **kwargs): There is a following piece of code: if not _callable(effect): result = next(effect) if _is_exception(result): raise result if result is DEFAULT