code: def test_exc(formatstr, args, exception, excmsg):
      try:
          testformat(formatstr, args)
      except exception as exc:
          if str(exc) == excmsg:
              if verbose:
                  print("yes")
          else:
              if verbose:
                  print("no")
              print("Unexpected ", exception, ":", repr(str(exc)))
      except:
          if verbose:
              print("no")
          print("Unexpected exception")
          raise
      else:
          raise TestFailed(
              "did not get expected exception: %s" % excmsg
          )
  
imports: from test.support import verbose, TestFailed
  import locale
  import sys
  import re
  import test.support
  import unittest
label_desc: Use image node_id 3 for calling a global function with example usage: test_exc(formatstr, args, exception, excmsg) without return types