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

2019-04-12 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks, I am closing this as not a bug. Feel free to reopen this if I have missed any. -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker

[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 ___

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

2019-04-11 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- pull_requests: -12717 ___ Python tracker ___ ___ Python-bugs-list mailing list

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

2019-04-11 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- keywords: +patch pull_requests: +12717 stage: -> patch review ___ Python tracker ___ ___

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

2019-04-11 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I am not sure if the snippets you are referring to are from testing-cabal/mock repo which could be different from master branch. Current code is at [0] if effect is not None: if _is_exception(effect): raise effect elif not

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

2019-04-10 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak versions: +Python 3.8 -Python 2.7 ___ Python tracker ___ ___ Python-bugs-list

[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: