def test_add_callback_with_failure(self):
        f = Future()
        e = Event()
        exc = []

        def set_exception():
            map = {}
            try:
                a = map["invalid_key"]
            except __HOLE__ as e:
                exc.append(sys.exc_info())
                f.set_exception(e, sys.exc_info()[2])

        def callback(future):
            exc_info = exc[0]
            self.assertEqual(exc_info[1], future.exception())
            self.assertEqual(exc_info[2], future.traceback())
            e.set()

        f.add_done_callback(callback)

        Thread(target=set_exception).start()

        self.assertTrue(e.wait(timeout=5))
dataset/ETHPy150Open hazelcast/hazelcast-python-client/tests/future_test.py/FutureTest.test_add_callback_with_failure