Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (22 sloc) 0.885 kb
from __future__ import absolute_import, division, with_statement
import sys
import unittest
from tornado.util import raise_exc_info
class RaiseExcInfoTest(unittest.TestCase):
def test_two_arg_exception(self):
# This test would fail on python 3 if raise_exc_info were simply
# a three-argument raise statement, because TwoArgException
# doesn't have a "copy constructor"
class TwoArgException(Exception):
def __init__(self, a, b):
super(TwoArgException, self).__init__()
self.a, self.b = a, b
raise TwoArgException(1, 2)
except TwoArgException:
exc_info = sys.exc_info()
raise_exc_info(exc_info)"didn't get expected exception")
except TwoArgException, e:
self.assertTrue(e is exc_info[1])
Jump to Line
Something went wrong with that request. Please try again.