From b24c9519b401bb66508e713789fab4f569398227 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 13 Jan 2009 22:14:01 +0000 Subject: [PATCH] Use assertRaises. --- Lib/test/test_ast.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index 994e10be7d8..1674b975755 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -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():