40
40
'check-multiple-inheritance.test' ,
41
41
'check-super.test' ,
42
42
'check-modules.test' ,
43
+ 'check-modules-fast.test' ,
43
44
'check-typevar-values.test' ,
44
45
'check-unsupported.test' ,
45
46
'check-unreachable-code.test' ,
111
112
if sys .platform in ('darwin' , 'win32' ):
112
113
typecheck_files .extend (['check-modules-case.test' ])
113
114
115
+ # some test cases are run multiple times with various combinations of extra flags
116
+ EXTRA_FLAGS = {
117
+ 'check-modules.test' : [['--fast-module-lookup' ]],
118
+ 'check-modules-fast.test' : [['--fast-module-lookup' ]],
119
+ 'check-modules-case.test' : [['--fast-module-lookup' ]],
120
+ }
121
+
114
122
115
123
class TypeCheckSuite (DataSuite ):
116
124
files = typecheck_files
@@ -138,10 +146,13 @@ def run_case(self, testcase: DataDrivenTestCase) -> None:
138
146
self .run_case_once (testcase , ops , step )
139
147
else :
140
148
self .run_case_once (testcase )
149
+ for extra_flags in EXTRA_FLAGS .get (os .path .basename (testcase .file ), []):
150
+ self .run_case_once (testcase , extra_flags = extra_flags )
141
151
142
152
def run_case_once (self , testcase : DataDrivenTestCase ,
143
153
operations : List [FileOperation ] = [],
144
- incremental_step : int = 0 ) -> None :
154
+ incremental_step : int = 0 ,
155
+ extra_flags : List [str ] = []) -> None :
145
156
original_program_text = '\n ' .join (testcase .input )
146
157
module_data = self .parse_module (original_program_text , incremental_step )
147
158
@@ -162,7 +173,8 @@ def run_case_once(self, testcase: DataDrivenTestCase,
162
173
perform_file_operations (operations )
163
174
164
175
# Parse options after moving files (in case mypy.ini is being moved).
165
- options = parse_options (original_program_text , testcase , incremental_step )
176
+ options = parse_options (original_program_text , testcase , incremental_step ,
177
+ extra_flags = extra_flags )
166
178
options .use_builtins_fixtures = True
167
179
options .show_traceback = True
168
180
0 commit comments