mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Process DEFAULT values in mock side_effect that returns iterator.
Patch by Michael Ford.
This commit is contained in:
commit
8ab1e513c1
2 changed files with 6 additions and 0 deletions
|
@ -931,6 +931,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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue