docstr: Same as assertRaises, but also compares the exception message.
docstr_tok: ["Same","as","assertRaises",",","but","also","compares","the","exception","message","."]
code: def assertRaisesWithMessage(self, e_class, e, func, *args, **kwargs):
      """Same as assertRaises, but also compares the exception message."""
      if hasattr(e_class, "__name__"):
          exc_name = e_class.__name__
      else:
          exc_name = str(e_class)
  
      try:
          func(*args, **kwargs)
      except e_class as expr:
          if str(expr) != e:
              msg = '%s raised, but with wrong message: "%s" instead of "%s"'
              raise self.failureException(
                  msg
                  % (
                      exc_name,
                      str(expr).encode("string_escape"),
                      e.encode("string_escape"),
                  )
              )
          return
      else:
          raise self.failureException("%s not raised" % exc_name)
  
imports: import difflib
  import re
  import unittest
  from google.protobuf import text_format
  from google.protobuf.internal import test_util
  from google.protobuf import unittest_pb2
  from google.protobuf import unittest_mset_pb2
label_desc: Use image node_id 34 for calling the TextFormatTest obj's underlying member method code with example usage: obj.assertRaisesWithMessage(e_class, e, func) without return types