What steps will reproduce the problem?
A mock with a return_value and a side_effects iterable will not return the
given return_value when the side_effect is DEFAULT.
From the attached patch:
mock = Mock(return_value=2)
mock.side_effect = iter([1, DEFAULT])
self.assertEqual([mock(), mock()], [1, 2])
What is the expected output? What do you see instead?
When side_effect is an iterable and one item is sentinel.DEFAULT the
corresponding call to the mock should return the return_value given in the mock
constructor. Instead it returns sentinel.DEFAULT.
What version of the product are you using? On what operating system?
Tested with changeset 950:63c726990a85.
Please provide any additional information below.
The attached patch includes a test case and a fix.
Original issue reported on code.google.com by oseem...@gmail.com on 22 Nov 2012 at 9:42
Original issue reported on code.google.com by
oseem...@gmail.com
on 22 Nov 2012 at 9:42Attachments: