1 # Test various flavors of legal and illegal future statements
3 from test_support
import unload
6 rx
= re
.compile('\((\S+).py, line (\d+)')
8 def check_error_location(msg
):
10 print "SyntaxError %s %s" % mo
.group(1, 2)
12 # The first two tests should work
14 unload('test_future1')
17 unload('test_future2')
20 unload('test_future3')
23 # The remaining tests should fail
25 import badsyntax_future3
26 except SyntaxError, msg
:
27 check_error_location(str(msg
))
30 import badsyntax_future4
31 except SyntaxError, msg
:
32 check_error_location(str(msg
))
35 import badsyntax_future5
36 except SyntaxError, msg
:
37 check_error_location(str(msg
))
40 import badsyntax_future6
41 except SyntaxError, msg
:
42 check_error_location(str(msg
))
45 import badsyntax_future7
46 except SyntaxError, msg
:
47 check_error_location(str(msg
))