def test_mark_as_failure(self):
        cb = CacheBackend(app=app)

        einfo = None
        tid3 = gen_unique_id()
        try:
            raise KeyError('foo')
        except __HOLE__ as exception:
            einfo = ExceptionInfo(sys.exc_info())
            cb.mark_as_failure(tid3, exception, traceback=einfo.traceback)
        self.assertEqual(cb.get_status(tid3), states.FAILURE)
        self.assertIsInstance(cb.get_result(tid3), KeyError)
        self.assertEqual(cb.get_traceback(tid3), einfo.traceback)
dataset/ETHPy150Open celery/django-celery/djcelery/tests/test_backends/test_cache.py/test_CacheBackend.test_mark_as_failure