diff options
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r-- | Lib/test/test_ast.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index b5295ef..75af646 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -197,6 +197,13 @@ class AST_Tests(unittest.TestCase): ast2 = mod.loads(mod.dumps(ast, protocol)) self.assertEquals(to_tuple(ast2), to_tuple(ast)) + def test_invalid_sum(self): + pos = dict(lineno=2, col_offset=3) + m = ast.Module([ast.Expr(ast.expr(**pos), **pos)]) + with self.assertRaises(TypeError) as cm: + compile(m, "<test>", "exec") + self.assertIn("but got <_ast.expr", str(cm.exception)) + class ASTHelpers_Test(unittest.TestCase): |