code: def test_3118(self):
      # deleting the generator caused the __context__ to be cleared
      def gen():
          try:
              yield 1
          finally:
              pass
  
      def f():
          g = gen()
          next(g)
          try:
              try:
                  raise ValueError
              except:
                  del g
                  raise KeyError
          except Exception as e:
              self.assertIsInstance(e.__context__, ValueError)
  
      f()
  
imports: from test import support
  import sys
  import types
  import unittest
label_desc: Use image node_id 12 for calling the TestContext obj's underlying member method code with example usage: obj.test_3118() without return types