This commit was manufactured by cvs2svn to create tag 'r211c1'.
[python/dscho.git] / Lib / test / test_future.py
blob1ffda5e36f88183511356ca74d347af81ee588c7
1 # Test various flavors of legal and illegal future statements
3 from test_support import unload
4 import re
6 rx = re.compile('\((\S+).py, line (\d+)')
8 def check_error_location(msg):
9 mo = rx.search(msg)
10 print "SyntaxError %s %s" % mo.group(1, 2)
12 # The first two tests should work
14 unload('test_future1')
15 import test_future1
17 unload('test_future2')
18 import test_future2
20 # The remaining tests should fail
21 try:
22 import test_future3
23 except SyntaxError, msg:
24 check_error_location(str(msg))
26 try:
27 import test_future4
28 except SyntaxError, msg:
29 check_error_location(str(msg))
31 try:
32 import test_future5
33 except SyntaxError, msg:
34 check_error_location(str(msg))
36 try:
37 import test_future6
38 except SyntaxError, msg:
39 check_error_location(str(msg))
41 try:
42 import test_future7
43 except SyntaxError, msg:
44 check_error_location(str(msg))