code: def test_debug_cleanup_same_loop(self):
      class Test(unittest.IsolatedAsyncioTestCase):
          async def asyncSetUp(self):
              async def coro():
                  await asyncio.sleep(0)
  
              fut = asyncio.ensure_future(coro())
              self.addAsyncCleanup(self.cleanup, fut)
              events.append("asyncSetUp")
  
          async def test_func(self):
              events.append("test")
              raise MyException()
  
          async def asyncTearDown(self):
              events.append("asyncTearDown")
  
          async def cleanup(self, fut):
              try:
                  # Raises an exception if in different loop
                  await asyncio.wait([fut])
                  events.append("cleanup")
              except:
                  import traceback
  
                  traceback.print_exc()
                  raise
  
      events = []
      test = Test("test_func")
      result = test.run()
      self.assertEqual(
          events, ["asyncSetUp", "test", "asyncTearDown", "cleanup"]
      )
      self.assertIn("MyException", result.errors[0][1])
  
      events = []
      test = Test("test_func")
      self.addCleanup(test._tearDownAsyncioRunner)
      try:
          test.debug()
      except MyException:
          pass
      else:
          self.fail("Expected a MyException exception")
      self.assertEqual(events, ["asyncSetUp", "test"])
      test.doCleanups()
      self.assertEqual(events, ["asyncSetUp", "test", "cleanup"])
  
imports: import asyncio
  import contextvars
  import unittest
  from test import support
label_desc: Use image node_id 13 for calling the TestAsyncCase obj's underlying member method code with example usage: obj.test_debug_cleanup_same_loop() without return types