def testBasicError(self):
    self.ExpectWarnings()
    frames = [sys._getframe()]

    @tasklets.tasklet
    def level3():
      frames.append(sys._getframe())
      raise RuntimeError('hello')
      yield

    @tasklets.tasklet
    def level2():
      frames.append(sys._getframe())
      yield level3()

    @tasklets.tasklet
    def level1():
      frames.append(sys._getframe())
      yield level2()

    @tasklets.tasklet
    def level0():
      frames.append(sys._getframe())
      yield level1()
    fut = level0()
    try:
      fut.check_success()
    except __HOLE__, err:
      _, _, tb = sys.exc_info()
      self.assertEqual(str(err), 'hello')
      tbframes = []
      while tb is not None:
        # It's okay if some _help_tasklet_along frames are present.
        if tb.tb_frame.f_code.co_name != '_help_tasklet_along':
          tbframes.append(tb.tb_frame)
        tb = tb.tb_next
      self.assertEqual(frames, tbframes)
    else:
      self.fail('Expected RuntimeError not raised')
dataset/ETHPy150Open GoogleCloudPlatform/datastore-ndb-python/ndb/tasklets_test.py/TracebackTests.testBasicError