summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ast.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-03-22 12:19:04 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-03-22 12:19:04 (GMT)
commiteff19a13ed4ca04e5be8c93a044952bad7de2054 (patch)
tree6f269bbd8a46c7ed9ba3c86577215fab030038dd /Lib/test/test_ast.py
parent0e3c1075495dfc1ed481f65091d1f9241868324a (diff)
downloadcpython-eff19a13ed4ca04e5be8c93a044952bad7de2054.zip
cpython-eff19a13ed4ca04e5be8c93a044952bad7de2054.tar.gz
cpython-eff19a13ed4ca04e5be8c93a044952bad7de2054.tar.bz2
check by equality for __future__ not identity (closes #14378)
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r--Lib/test/test_ast.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index e3aa5b1..4f80197 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -231,6 +231,12 @@ class AST_Tests(unittest.TestCase):
im = ast.parse("from . import y").body[0]
self.assertIsNone(im.module)
+ def test_non_interned_future_from_ast(self):
+ mod = ast.parse("from __future__ import division")
+ self.assertIsInstance(mod.body[0], ast.ImportFrom)
+ mod.body[0].module = " __future__ ".strip()
+ compile(mod, "<test>", "exec")
+
def test_base_classes(self):
self.assertTrue(issubclass(ast.For, ast.stmt))
self.assertTrue(issubclass(ast.Name, ast.expr))