Skip to content

bpo-38870: Fix error when running with -uall in test_unparse #17739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Lib/test/test_unparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
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.
tests_to_run_always = {item for item in items if
item.name in cls.run_always_files}

items = set(random.sample(items, 10))

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.
Expand Down