[New-bugs-announce] [issue17502] unittest.mock: side_effect iterators ignore DEFAULT

Michael Foord report at bugs.python.org
Thu Mar 21 04:05:40 CET 2013


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 <report at bugs.python.org>
<http://bugs.python.org/issue17502>
_______________________________________


More information about the New-bugs-announce mailing list