Commit 547f4633 by Chris Dodge

use better syntax for asserting that exception is thrown

parent ab4012cc
...@@ -203,11 +203,9 @@ class TestSerialize(unittest.TestCase): ...@@ -203,11 +203,9 @@ class TestSerialize(unittest.TestCase):
assert_equals('1 day 12 hours 59 minutes 59 seconds', assert_equals('1 day 12 hours 59 minutes 59 seconds',
serialize_string_literal("1 day 12 hours 59 minutes 59 seconds")) serialize_string_literal("1 day 12 hours 59 minutes 59 seconds"))
try: # make sure we can't call serialize_string_literal with a non basestring type
with self.assertRaises(TypeError):
self.assertRaises(serialize_string_literal(2.31)) self.assertRaises(serialize_string_literal(2.31))
except Exception:
pass
class TestDeserialize(unittest.TestCase): class TestDeserialize(unittest.TestCase):
def assertDeserializeEqual(self, expected, arg): def assertDeserializeEqual(self, expected, arg):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment