def testTasklets_Raising(self):
    self.ExpectWarnings()

    @tasklets.tasklet
    def t1():
      f = t2(True)
      try:
        yield f
      except __HOLE__, err:
        self.assertEqual(f.get_exception(), err)
        raise tasklets.Return(str(err))

    @tasklets.tasklet
    def t2(error):
      if error:
        raise RuntimeError('hello')
      else:
        yield tasklets.Future()
    x = t1()
    y = x.get_result()
    self.assertEqual(y, 'hello')
dataset/ETHPy150Open GoogleCloudPlatform/datastore-ndb-python/ndb/tasklets_test.py/TaskletTests.testTasklets_Raising