Process DEFAULT values in mock side_effect that returns iterator.

Patch by Michael Ford.
This commit is contained in:
Andrew Svetlov 2013-04-07 16:42:24 +03:00
parent 595365de32
commit 8b2cd75bdd
2 changed files with 6 additions and 0 deletions

View file

@ -904,6 +904,8 @@ class CallableMixin(Base):
result = next(effect)
if _is_exception(result):
raise result
if result is DEFAULT:
result = self.return_value
return result
ret_val = effect(*args, **kwargs)