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.
This commit is contained in:
Ben Darnell 2012-05-27 18:37:10 -07:00
parent 9118028671
commit 5e514195b1
1 changed files with 3 additions and 3 deletions

View File

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