From: Ben Darnell Date: Mon, 28 May 2012 01:37:10 +0000 (-0700) Subject: Remove use of string exceptions in gen_test. X-Git-Tag: v2.3.0~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e514195b1258a3b72a2d2200e06c1f8e23621c6;p=thirdparty%2Ftornado.git Remove use of string exceptions in gen_test. These lines are not reached, but if they were they would fail with a less clear message than intended. Closes #520. --- diff --git a/tornado/test/gen_test.py b/tornado/test/gen_test.py index 198190cbb..c45ba540d 100644 --- a/tornado/test/gen_test.py +++ b/tornado/test/gen_test.py @@ -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()