summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-01-13 22:14:01 (GMT)
committerGeorg Brandl <georg@python.org>2009-01-13 22:14:01 (GMT)
commitb24c9519b401bb66508e713789fab4f569398227 (patch)
tree24bf4200fd7934cf1a9f30ea9e6f932242820bb4
parent3bf451aec11e39621991b8451fcddfefe5d0e2f2 (diff)
downloadcpython-b24c9519b401bb66508e713789fab4f569398227.zip
cpython-b24c9519b401bb66508e713789fab4f569398227.tar.gz
cpython-b24c9519b401bb66508e713789fab4f569398227.tar.bz2
Use assertRaises.
-rw-r--r--Lib/test/test_ast.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 994e10b..1674b97 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():