I want to be able to have multiple calls to a particular attribute function return a different result for each successive call.
In the below example, I would like increm
You can just pass an iterable to side effect and have it iterate through the list of values for each call you make.
@mock.patch("A.increment") def test_method(self, mock_increment): mock_increment.side_effect = [5,10] self.assertEqual(mock_increment(), 5) self.assertEqual(mock_increment(), 10)