Go to the documentation of this file.00001 from __future__ import absolute_import, division, with_statement
00002 import sys
00003 import unittest
00004
00005 from tornado.util import raise_exc_info
00006
00007
00008 class RaiseExcInfoTest(unittest.TestCase):
00009 def test_two_arg_exception(self):
00010
00011
00012
00013 class TwoArgException(Exception):
00014 def __init__(self, a, b):
00015 super(TwoArgException, self).__init__()
00016 self.a, self.b = a, b
00017
00018 try:
00019 raise TwoArgException(1, 2)
00020 except TwoArgException:
00021 exc_info = sys.exc_info()
00022 try:
00023 raise_exc_info(exc_info)
00024 self.fail("didn't get expected exception")
00025 except TwoArgException, e:
00026 self.assertTrue(e is exc_info[1])