def test_get_raises_exception_with_full_traceback(self):
        exc_class_get = None
        exc_class_set = None
        exc_instance_get = None
        exc_instance_set = None
        exc_traceback_get = None
        exc_traceback_set = None
        future = self.future_class()

        try:
            raise NameError('foo')
        except __HOLE__:
            exc_class_set, exc_instance_set, exc_traceback_set = sys.exc_info()
            future.set_exception()

        # We could move to another thread at this point

        try:
            future.get()
        except NameError:
            exc_class_get, exc_instance_get, exc_traceback_get = sys.exc_info()

        self.assertEqual(exc_class_set, exc_class_get)
        self.assertEqual(exc_instance_set, exc_instance_get)

        exc_traceback_list_set = list(reversed(
            traceback.extract_tb(exc_traceback_set)))
        exc_traceback_list_get = list(reversed(
            traceback.extract_tb(exc_traceback_get)))

        # All frames from the first traceback should be included in the
        # traceback from the future.get() reraise
        self.assert_(len(exc_traceback_list_set) < len(exc_traceback_list_get))
        for i, frame in enumerate(exc_traceback_list_set):
            self.assertEquals(frame, exc_traceback_list_get[i])
dataset/ETHPy150Open jodal/pykka/tests/future_test.py/FutureTest.test_get_raises_exception_with_full_traceback