diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2019-12-29 19:20:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-29 19:20:55 (GMT) |
commit | 23a226bf3ae7b462084e899d007d12d9fe398ac5 (patch) | |
tree | 636970934396128390488c91cfaeffb0677b947d /Lib/test | |
parent | cbd0408b54c8f9512bfeace2aaf9da064053e86d (diff) | |
download | cpython-23a226bf3ae7b462084e899d007d12d9fe398ac5.zip cpython-23a226bf3ae7b462084e899d007d12d9fe398ac5.tar.gz cpython-23a226bf3ae7b462084e899d007d12d9fe398ac5.tar.bz2 |
bpo-38870: Run always tests that heavily use grammar features in test_unparse (GH-17738)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_unparse.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Lib/test/test_unparse.py b/Lib/test/test_unparse.py index 45d819f..3e79686 100644 --- a/Lib/test/test_unparse.py +++ b/Lib/test/test_unparse.py @@ -285,6 +285,8 @@ class DirectoryTestCase(ASTTestCase): lib_dir = pathlib.Path(__file__).parent / ".." test_directories = (lib_dir, lib_dir / "test") skip_files = {"test_fstring.py"} + run_always_files = {"test_grammar.py", "test_syntax.py", "test_compile.py", + "test_ast.py", "test_asdl_parser.py"} _files_to_test = None @@ -301,9 +303,17 @@ class DirectoryTestCase(ASTTestCase): if not item.name.startswith("bad") ] + tests_to_run_always = {item for item in items if + item.name in cls.run_always_files} + # Test limited subset of files unless the 'cpu' resource is specified. if not test.support.is_resource_enabled("cpu"): - items = random.sample(items, 10) + items = set(random.sample(items, 10)) + + # Make sure that at least tests that heavily use grammar features are + # considered to reduce the change of missing something. + + items = list(items | tests_to_run_always) # bpo-31174: Store the names sample to always test the same files. # It prevents false alarms when hunting reference leaks. |