def test_result_raises_exception_with_traceback(self):
        f = Future()
        exc_info = None
        try:
            {}["invalid_key"]
        except __HOLE__ as e:
            exc_info = sys.exc_info()
            f.set_exception(e, sys.exc_info()[2])

        try:
            f.result()
            self.fail("Future.result() should raise exception")
        except:
            info = sys.exc_info()
            self.assertEqual(info[1], exc_info[1])

            original_tb = traceback.extract_tb(exc_info[2])
            # shift traceback by one to discard the last frame
            actual_tb = traceback.extract_tb(info[2])[1:]

            self.assertEqual(original_tb, actual_tb)
dataset/ETHPy150Open hazelcast/hazelcast-python-client/tests/future_test.py/FutureTest.test_result_raises_exception_with_traceback