]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Remove use of string exceptions in gen_test.
authorBen Darnell <ben@bendarnell.com>
Mon, 28 May 2012 01:37:10 +0000 (18:37 -0700)
committerBen Darnell <ben@bendarnell.com>
Mon, 28 May 2012 01:37:10 +0000 (18:37 -0700)
These lines are not reached, but if they were they would fail with
a less clear message than intended.

Closes #520.

tornado/test/gen_test.py

index 198190cbb2df6f2e05c47d5303996f5dbabd2b39..c45ba540de8700672337e67e7135f0591474db73 100644 (file)
@@ -168,7 +168,7 @@ class GenTest(AsyncTestCase):
         def f():
             try:
                 yield gen.Wait("k1")
-                raise "did not get expected exception"
+                raise Exception("did not get expected exception")
             except gen.UnknownKeyError:
                 pass
             self.stop()
@@ -179,7 +179,7 @@ class GenTest(AsyncTestCase):
         def f():
             try:
                 yield gen.Wait("k1")
-                raise "did not get expected exception"
+                raise Exception("did not get expected exception")
             except gen.UnknownKeyError:
                 pass
             (yield gen.Callback("k2"))("v2")
@@ -193,7 +193,7 @@ class GenTest(AsyncTestCase):
             self.orphaned_callback = yield gen.Callback(1)
         try:
             self.run_gen(f)
-            raise "did not get expected exception"
+            raise Exception("did not get expected exception")
         except gen.LeakedCallbackError:
             pass
         self.orphaned_callback()