blob: 1ffda5e36f88183511356ca74d347af81ee588c7 [file] [log] [blame]
Jeremy Hylton62e2c7e2001-02-28 17:48:06 +00001# Test various flavors of legal and illegal future statements
2
3from test_support import unload
4import re
5
6rx = re.compile('\((\S+).py, line (\d+)')
7
8def check_error_location(msg):
9 mo = rx.search(msg)
10 print "SyntaxError %s %s" % mo.group(1, 2)
11
12# The first two tests should work
13
14unload('test_future1')
15import test_future1
16
17unload('test_future2')
18import test_future2
19
20# The remaining tests should fail
21try:
22 import test_future3
23except SyntaxError, msg:
24 check_error_location(str(msg))
25
26try:
27 import test_future4
28except SyntaxError, msg:
29 check_error_location(str(msg))
30
31try:
32 import test_future5
33except SyntaxError, msg:
34 check_error_location(str(msg))
35
36try:
37 import test_future6
38except SyntaxError, msg:
39 check_error_location(str(msg))
40
41try:
42 import test_future7
43except SyntaxError, msg:
44 check_error_location(str(msg))