File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,8 @@ class DirectoryTestCase(ASTTestCase):
285
285
lib_dir = pathlib .Path (__file__ ).parent / ".."
286
286
test_directories = (lib_dir , lib_dir / "test" )
287
287
skip_files = {"test_fstring.py" }
288
+ run_always_files = {"test_grammar.py" , "test_syntax.py" , "test_compile.py" ,
289
+ "test_ast.py" , "test_asdl_parser.py" }
288
290
289
291
_files_to_test = None
290
292
@@ -301,9 +303,17 @@ def files_to_test(cls):
301
303
if not item .name .startswith ("bad" )
302
304
]
303
305
306
+ tests_to_run_always = {item for item in items if
307
+ item .name in cls .run_always_files }
308
+
304
309
# Test limited subset of files unless the 'cpu' resource is specified.
305
310
if not test .support .is_resource_enabled ("cpu" ):
306
- items = random .sample (items , 10 )
311
+ items = set (random .sample (items , 10 ))
312
+
313
+ # Make sure that at least tests that heavily use grammar features are
314
+ # considered to reduce the change of missing something.
315
+
316
+ items = list (items | tests_to_run_always )
307
317
308
318
# bpo-31174: Store the names sample to always test the same files.
309
319
# It prevents false alarms when hunting reference leaks.
You can’t perform that action at this time.
0 commit comments