Fix error when running with -uall in test_unparse (GH-17739)

This commit is contained in:
Pablo Galindo 2019-12-29 20:18:36 +00:00 committed by GitHub
parent 23a226bf3a
commit be287c3191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -303,17 +303,17 @@ def files_to_test(cls):
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"):
tests_to_run_always = {item for item in items if
item.name in cls.run_always_files}
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)
# Make sure that at least tests that heavily use grammar features are
# always considered in order to reduce the chance 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.