mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-105908: fix barry_as_FLUFL
future import (#105909)
This commit is contained in:
parent
1858db7cbd
commit
28187a9c4f
3 changed files with 19 additions and 6 deletions
|
@ -4,6 +4,7 @@ import __future__
|
|||
import ast
|
||||
import unittest
|
||||
from test.support import import_helper
|
||||
from test.support.script_helper import spawn_python, kill_python
|
||||
from textwrap import dedent
|
||||
import os
|
||||
import re
|
||||
|
@ -121,6 +122,13 @@ class FutureTest(unittest.TestCase):
|
|||
exec("from __future__ import unicode_literals; x = ''", {}, scope)
|
||||
self.assertIsInstance(scope["x"], str)
|
||||
|
||||
def test_syntactical_future_repl(self):
|
||||
p = spawn_python('-i')
|
||||
p.stdin.write(b"from __future__ import barry_as_FLUFL\n")
|
||||
p.stdin.write(b"2 <> 3\n")
|
||||
out = kill_python(p)
|
||||
self.assertNotIn(b'SyntaxError: invalid syntax', out)
|
||||
|
||||
class AnnotationsFutureTestCase(unittest.TestCase):
|
||||
template = dedent(
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue