summaryrefslogtreecommitdiff
path: root/Lib/test/test_parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_parser.py')
-rw-r--r--Lib/test/test_parser.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index c1a22ae095..cec4c70aa2 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -25,6 +25,15 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
def check_expr(self, s):
self.roundtrip(parser.expr, s)
+ def test_flags_passed(self):
+ # The unicode literals flags has to be passed from the paser to AST
+ # generation.
+ suite = parser.suite("from __future__ import unicode_literals; x = ''")
+ code = suite.compile()
+ scope = {}
+ exec(code, {}, scope)
+ self.assertTrue(isinstance(scope["x"], str))
+
def check_suite(self, s):
self.roundtrip(parser.suite, s)