diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-03-22 12:19:04 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-03-22 12:19:04 (GMT) |
commit | a4e4e35783d26151be19253ff6dd1c3ec2ca7efa (patch) | |
tree | 548bf2b8c05481fe603f48189579ea7404532900 /Lib | |
parent | e112153727def076478a84733f30a8f44f4c8844 (diff) | |
download | cpython-a4e4e35783d26151be19253ff6dd1c3ec2ca7efa.zip cpython-a4e4e35783d26151be19253ff6dd1c3ec2ca7efa.tar.gz cpython-a4e4e35783d26151be19253ff6dd1c3ec2ca7efa.tar.bz2 |
check by equality for __future__ not identity (closes #14378)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_ast.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index f4ce615..e22d4de 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -218,6 +218,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)) |