def side_effect(self, func, *args, **kwargs):
        '''
        Wrap side effects for spies.
        '''
        self._spy_side_effect = func
        self._spy_side_effect_args = args
        self._spy_side_effect_kwargs = kwargs
        return self
def side_effect ( self , func , * args , ** kwargs ) : self . _spy_side_effect = func self . _spy_side_effect_args = args self . _spy_side_effect_kwargs = kwargs return self
Wrap side effects for spies.