Initialize member variables in AsyncTestCase.__init__ instead of setUp
to avoid masking the real error in _stack_context() if run() throws an exception.
This commit is contained in:
parent
33fe4a4e90
commit
551ea94d24
|
@ -74,13 +74,17 @@ class AsyncTestCase(unittest.TestCase):
|
||||||
response = self.wait()
|
response = self.wait()
|
||||||
# Test contents of response
|
# Test contents of response
|
||||||
"""
|
"""
|
||||||
def setUp(self):
|
def __init__(self, *args, **kwargs):
|
||||||
self.io_loop = self.get_new_ioloop()
|
super(AsyncTestCase, self).__init__(*args, **kwargs)
|
||||||
self.__stopped = False
|
self.__stopped = False
|
||||||
self.__running = False
|
self.__running = False
|
||||||
self.__failure = None
|
self.__failure = None
|
||||||
self.__stop_args = None
|
self.__stop_args = None
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super(AsyncTestCase, self).setUp()
|
||||||
|
self.io_loop = self.get_new_ioloop()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
if self.io_loop is not tornado.ioloop.IOLoop.instance():
|
if self.io_loop is not tornado.ioloop.IOLoop.instance():
|
||||||
# Try to clean up any file descriptors left open in the ioloop.
|
# Try to clean up any file descriptors left open in the ioloop.
|
||||||
|
|
Loading…
Reference in New Issue