Kaydet (Commit) b24c9519 authored tarafından Georg Brandl's avatar Georg Brandl

Use assertRaises.

üst 3bf451ae
......@@ -275,12 +275,7 @@ class ASTHelpers_Test(unittest.TestCase):
self.assertEqual(ast.literal_eval('2j'), 2j)
self.assertEqual(ast.literal_eval('10 + 2j'), 10 + 2j)
self.assertEqual(ast.literal_eval('1.5 - 2j'), 1.5 - 2j)
try:
ast.literal_eval('2 + (3 + 4j)')
except ValueError:
pass
else:
self.fail('expected value error')
self.assertRaises(ValueError, ast.literal_eval, '2 + (3 + 4j)')
def test_main():
......
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