Skip to content

Commit ab9b605

Browse files
[3.12] gh-116860: Remove outdated test_parserhack from test_future (GH-116861) (#119648)
gh-116860: Remove outdated `test_parserhack` from `test_future` (GH-116861) (cherry picked from commit 669175b) Co-authored-by: Nikita Sobolev <[email protected]>
1 parent 8fb4854 commit ab9b605

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

Lib/test/test_future_stmt/test_future.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -107,26 +107,6 @@ def test_ensure_flags_dont_clash(self):
107107
}
108108
self.assertCountEqual(set(flags.values()), flags.values())
109109

110-
def test_parserhack(self):
111-
# test that the parser.c::future_hack function works as expected
112-
# Note: although this test must pass, it's not testing the original
113-
# bug as of 2.6 since the with statement is not optional and
114-
# the parser hack disabled. If a new keyword is introduced in
115-
# 2.6, change this to refer to the new future import.
116-
try:
117-
exec("from __future__ import print_function; print 0")
118-
except SyntaxError:
119-
pass
120-
else:
121-
self.fail("syntax error didn't occur")
122-
123-
try:
124-
exec("from __future__ import (print_function); print 0")
125-
except SyntaxError:
126-
pass
127-
else:
128-
self.fail("syntax error didn't occur")
129-
130110
def test_unicode_literals_exec(self):
131111
scope = {}
132112
exec("from __future__ import unicode_literals; x = ''", {}, scope)

0 commit comments

Comments
 (0)