New submission from Michael Foord:
An iterator set as a mock side_effect should be able to include mock.DEFAULT to
use the standard return value.
def test_side_effect_iterator_default(self):
mock = Mock(return_value=2)
mock.side_effect = [1, DEFAULT]
result = mock(), mock()
self.assertEqual(result, (1, 2))
----------
assignee: michael.foord
keywords: easy
messages: 184836
nosy: michael.foord
priority: normal
severity: normal
stage: needs patch
status: open
title: unittest.mock: side_effect iterators ignore DEFAULT
type: behavior
versions: Python 3.3, Python 3.4
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue17502>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com