The "wraps" keyword allows us to specify that a mock wraps another object, delegating method calls to that object. Per the documentation, the delegation can be overridden by specifying a "return_value" for that method on the mock as usual.
On the other hand, "side_effect", among other things, allows us to specify a callable to generate the return value instead of specifying it explicitly.
Each of these features are very useful, and indispensable for some cases. There are, of course, some cases where using both would be very handy. Unfortunately, this is not currently supported. The "side_effect" attribute is currently ignored for method calls on Mock objects using "wraps". It should be supported just as "return_value" is.
wraps and side_effect: two great tastes that taste great together!
Status: New
Labels:
Type-Defect
Priority-Medium