Revision 93029a5b qa/qa_utils.py

b/qa/qa_utils.py
107 107
_SetupColours()
108 108

  
109 109

  
110
def AssertIn(item, sequence):
110
def AssertIn(item, sequence, msg=""):
111 111
  """Raises an error when item is not in sequence.
112 112

  
113 113
  """
114 114
  if item not in sequence:
115
    raise qa_error.Error("%r not in %r" % (item, sequence))
115
    if msg:
116
      raise qa_error.Error("%s: %r not in %r" % (msg, item, sequence))
117
    else:
118
      raise qa_error.Error("%r not in %r" % (item, sequence))
116 119

  
117 120

  
118 121
def AssertNotIn(item, sequence):

Also available in: Unified diff