@@ -25,57 +25,71 @@ def check_syntax_error(self, err, basename, lineno, offset=1):
25
25
self .assertEqual (err .offset , offset )
26
26
27
27
def test_future1 (self ):
28
- with import_helper .CleanImport ('future_test1' ):
29
- from test import future_test1
28
+ with import_helper .CleanImport ('test.test_future_stmt. future_test1' ):
29
+ from test . test_future_stmt import future_test1
30
30
self .assertEqual (future_test1 .result , 6 )
31
31
32
32
def test_future2 (self ):
33
- with import_helper .CleanImport ('future_test2' ):
34
- from test import future_test2
33
+ with import_helper .CleanImport ('test.test_future_stmt. future_test2' ):
34
+ from test . test_future_stmt import future_test2
35
35
self .assertEqual (future_test2 .result , 6 )
36
36
37
- def test_future3 (self ):
38
- with import_helper .CleanImport ('test_future3' ):
39
- from test import test_future3
37
+ def test_future_single_import (self ):
38
+ with import_helper .CleanImport (
39
+ 'test.test_future_stmt.test_future_single_import' ,
40
+ ):
41
+ from test .test_future_stmt import test_future_single_import
42
+
43
+ def test_future_multiple_imports (self ):
44
+ with import_helper .CleanImport (
45
+ 'test.test_future_stmt.test_future_multiple_imports' ,
46
+ ):
47
+ from test .test_future_stmt import test_future_multiple_imports
48
+
49
+ def test_future_multiple_features (self ):
50
+ with import_helper .CleanImport (
51
+ "test.test_future_stmt.test_future_multiple_features" ,
52
+ ):
53
+ from test .test_future_stmt import test_future_multiple_features
40
54
41
55
def test_badfuture3 (self ):
42
56
with self .assertRaises (SyntaxError ) as cm :
43
- from test import badsyntax_future3
57
+ from test . test_future_stmt import badsyntax_future3
44
58
self .check_syntax_error (cm .exception , "badsyntax_future3" , 3 )
45
59
46
60
def test_badfuture4 (self ):
47
61
with self .assertRaises (SyntaxError ) as cm :
48
- from test import badsyntax_future4
62
+ from test . test_future_stmt import badsyntax_future4
49
63
self .check_syntax_error (cm .exception , "badsyntax_future4" , 3 )
50
64
51
65
def test_badfuture5 (self ):
52
66
with self .assertRaises (SyntaxError ) as cm :
53
- from test import badsyntax_future5
67
+ from test . test_future_stmt import badsyntax_future5
54
68
self .check_syntax_error (cm .exception , "badsyntax_future5" , 4 )
55
69
56
70
def test_badfuture6 (self ):
57
71
with self .assertRaises (SyntaxError ) as cm :
58
- from test import badsyntax_future6
72
+ from test . test_future_stmt import badsyntax_future6
59
73
self .check_syntax_error (cm .exception , "badsyntax_future6" , 3 )
60
74
61
75
def test_badfuture7 (self ):
62
76
with self .assertRaises (SyntaxError ) as cm :
63
- from test import badsyntax_future7
77
+ from test . test_future_stmt import badsyntax_future7
64
78
self .check_syntax_error (cm .exception , "badsyntax_future7" , 3 , 54 )
65
79
66
80
def test_badfuture8 (self ):
67
81
with self .assertRaises (SyntaxError ) as cm :
68
- from test import badsyntax_future8
82
+ from test . test_future_stmt import badsyntax_future8
69
83
self .check_syntax_error (cm .exception , "badsyntax_future8" , 3 )
70
84
71
85
def test_badfuture9 (self ):
72
86
with self .assertRaises (SyntaxError ) as cm :
73
- from test import badsyntax_future9
87
+ from test . test_future_stmt import badsyntax_future9
74
88
self .check_syntax_error (cm .exception , "badsyntax_future9" , 3 )
75
89
76
90
def test_badfuture10 (self ):
77
91
with self .assertRaises (SyntaxError ) as cm :
78
- from test import badsyntax_future10
92
+ from test . test_future_stmt import badsyntax_future10
79
93
self .check_syntax_error (cm .exception , "badsyntax_future10" , 3 )
80
94
81
95
def test_ensure_flags_dont_clash (self ):
@@ -113,10 +127,6 @@ def test_parserhack(self):
113
127
else :
114
128
self .fail ("syntax error didn't occur" )
115
129
116
- def test_multiple_features (self ):
117
- with import_helper .CleanImport ("test.test_future5" ):
118
- from test import test_future5
119
-
120
130
def test_unicode_literals_exec (self ):
121
131
scope = {}
122
132
exec ("from __future__ import unicode_literals; x = ''" , {}, scope )
0 commit comments