summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ast.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2011-11-22 21:02:01 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2011-11-22 21:02:01 (GMT)
commit942d5ba125860112c42f3a8981778c80c23d5499 (patch)
tree142f9ed4e3e83cee234402d0be2ca9d28839acd8 /Lib/test/test_ast.py
parent02686751931e6cd267f60c65b59744c7dff50cd2 (diff)
parent5e8f8104116edfcbfee2690a58391830bd9883ae (diff)
downloadcpython-942d5ba125860112c42f3a8981778c80c23d5499.zip
cpython-942d5ba125860112c42f3a8981778c80c23d5499.tar.gz
cpython-942d5ba125860112c42f3a8981778c80c23d5499.tar.bz2
Merge branch 3.2
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r--Lib/test/test_ast.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 4fbe5b4..b1656bc 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -491,6 +491,17 @@ class ASTHelpers_Test(unittest.TestCase):
self.assertEqual(ast.literal_eval('10 + 2j'), 10 + 2j)
self.assertEqual(ast.literal_eval('1.5 - 2j'), 1.5 - 2j)
+ def test_bad_integer(self):
+ # issue13436: Bad error message with invalid numeric values
+ body = [ast.ImportFrom(module='time',
+ names=[ast.alias(name='sleep')],
+ level=None,
+ lineno=None, col_offset=None)]
+ mod = ast.Module(body)
+ with self.assertRaises(ValueError) as cm:
+ compile(mod, 'test', 'exec')
+ self.assertIn("invalid integer value: None", str(cm.exception))
+
class ASTValidatorTests(unittest.TestCase):