Hi, I have a use case where I'd like to use mocker.spy() to record all calls to and return values from a callable, however as far as I can tell mocker.spy() only records the most recent call (as spy_return).
Would you welcome a merge request adding this, and if so, do you have any opinions on the API?
I was thinking of something like spy_returns or spy_return_list, which would be a list of return values. I'm not sure how best to handle exceptions - put the return values and exceptions in the same list so the user can determine order, or have two lists? Alternatively just assume that if you're expecting an exception there's less likely to be a need to call it multiple times.
Hi, I have a use case where I'd like to use
mocker.spy()to record all calls to and return values from a callable, however as far as I can tellmocker.spy()only records the most recent call (asspy_return).Would you welcome a merge request adding this, and if so, do you have any opinions on the API?
I was thinking of something like
spy_returnsorspy_return_list, which would be a list of return values. I'm not sure how best to handle exceptions - put the return values and exceptions in the same list so the user can determine order, or have two lists? Alternatively just assume that if you're expecting an exception there's less likely to be a need to call it multiple times.