summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ast.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-11-20 01:38:49 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-11-20 01:38:49 (GMT)
commit5b066817e2e777c8eff7776335482b9d6efd115b (patch)
tree4dc23dae3fd2708e743d7fcae0f210fed39887d0 /Lib/test/test_ast.py
parentc8c60c22845177f419e4de7305102310e336b1f0 (diff)
downloadcpython-5b066817e2e777c8eff7776335482b9d6efd115b.zip
cpython-5b066817e2e777c8eff7776335482b9d6efd115b.tar.gz
cpython-5b066817e2e777c8eff7776335482b9d6efd115b.tar.bz2
use %R format code; fixes invalid dereferencing #10391
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r--Lib/test/test_ast.py7
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):