reject non-docs strings between future imports (closes #17434)

This commit is contained in:
Benjamin Peterson 2013-03-16 09:15:47 -07:00
parent 694bafa04e
commit 2d6acd2ac2
4 changed files with 28 additions and 11 deletions

View file

@ -82,6 +82,14 @@ class FutureTest(unittest.TestCase):
else:
self.fail("expected exception didn't occur")
def test_badfuture10(self):
try:
from test import badsyntax_future10
except SyntaxError as msg:
self.assertEqual(get_error_location(msg), ("badsyntax_future10", '3'))
else:
self.fail("expected exception didn't occur")
def test_parserhack(self):
# test that the parser.c::future_hack function works as expected
# Note: although this test must pass, it's not testing the original