def _patch_multiple(target, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs):
 def g_importer():
  return _importer(target)
 def g_target():
  return target
 if (type(target) in (unicode, str)):
  getter = g_importer
 else:
  getter = g_target
 if (not kwargs):
  raise ValueError('Must supply at least one keyword argument with patch.multiple')
 items = list(kwargs.items())
 (attribute, new) = items[0]
 patcher = _patch(getter, attribute, new, spec, create, spec_set, autospec, new_callable, {})
 patcher.attribute_name = attribute
 for (attribute, new) in items[1:]:
  this_patcher = _patch(getter, attribute, new, spec, create, spec_set, autospec, new_callable, {})
  this_patcher.attribute_name = attribute
  patcher.additional_patchers.append(this_patcher)
 return patcher

def _patch_multiple ( target , spec = None , create = False , spec_set = None , autospec = None , new_callable = None , ** kwargs ) : def g_importer ( ) : return _importer ( target ) def g_target ( ) : return target if ( type ( target ) in ( unicode , str ) ) : getter = g_importer else : getter = g_target if ( not kwargs ) : raise ValueError ( 'Must supply at least one keyword argument with patch.multiple' ) items = list ( kwargs . items ( ) ) ( attribute , new ) = items [ 0 ] patcher = _patch ( getter , attribute , new , spec , create , spec_set , autospec , new_callable , { } ) patcher . attribute_name = attribute for ( attribute , new ) in items [ 1 : ] : this_patcher = _patch ( getter , attribute , new , spec , create , spec_set , autospec , new_callable , { } ) this_patcher . attribute_name = attribute patcher . additional_patchers . append ( this_patcher ) return patcher
perform multiple patches in a single call .