code: def test_exceptions(self):
      ex = self.ex
      ex.runcode("1/0")
      self.assertIs(ex.user_exc_info[0], ZeroDivisionError)
  
      self.addCleanup(setattr, sys, "excepthook", sys.__excepthook__)
      sys.excepthook = lambda t, e, tb: run.print_exception(t)
      ex.runcode("1/0")
      self.assertIs(self.prt.args[0], ZeroDivisionError)
  
      sys.excepthook = lambda: None
      ex.runcode("1/0")
      t, e, tb = ex.user_exc_info
      self.assertIs(t, TypeError)
      self.assertTrue(isinstance(e.__context__, ZeroDivisionError))
  
imports: from idlelib import run
  import io
  import sys
  from test.support import captured_output, captured_stderr
  import unittest
  from unittest import mock
  import idlelib
  from idlelib.idle_test.mock_idle import Func
label_desc: Use image node_id 3 for calling the ExecRuncodeTest obj's underlying member method code with example usage: obj.test_exceptions() without return types