def num_mock_patch_args(function):
 patchings = getattr(function, 'patchings', None)
 if (not patchings):
  return 0
 mock = sys.modules.get('mock', sys.modules.get('unittest.mock', None))
 if (mock is not None):
  return len([p for p in patchings if ((not p.attribute_name) and (p.new is mock.DEFAULT))])
 return len(patchings)

def num_mock_patch_args ( function ) : patchings = getattr ( function , 'patchings' , None ) if ( not patchings ) : return 0 mock = sys . modules . get ( 'mock' , sys . modules . get ( 'unittest.mock' , None ) ) if ( mock is not None ) : return len ( [ p for p in patchings if ( ( not p . attribute_name ) and ( p . new is mock . DEFAULT ) ) ] ) return len ( patchings )
return number of arguments used up by mock arguments .