def mocksignature(func, mock=None, skipfirst=False):
 if (mock is None):
  mock = Mock()
 (signature, func) = _getsignature(func, skipfirst)
 src = ('lambda %(signature)s: _mock_(%(signature)s)' % {'signature': signature})
 funcopy = eval(src, dict(_mock_=mock))
 _copy_func_details(func, funcopy)
 funcopy.mock = mock
 return funcopy

def mocksignature ( func , mock = None , skipfirst = False ) : if ( mock is None ) : mock = Mock ( ) ( signature , func ) = _getsignature ( func , skipfirst ) src = ( 'lambda %(signature)s: _mock_(%(signature)s)' % { 'signature' : signature } ) funcopy = eval ( src , dict ( _mock_ = mock ) ) _copy_func_details ( func , funcopy ) funcopy . mock = mock return funcopy
mocksignature create a new function with the same signature as func that delegates to mock .