mirror of
https://github.com/python/cpython.git
synced 2025-08-15 14:20:55 +00:00
check by equality for __future__ not identity (closes #14378)
This commit is contained in:
parent
0e3c107549
commit
eff19a13ed
3 changed files with 12 additions and 8 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue