From 06e35493906029f32334533d7d4b0b0ea6165401 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Sun, 29 Dec 2019 19:22:57 +0000 Subject: [PATCH] Fix error when running with -uall in test_unparse --- Lib/test/test_unparse.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Lib/test/test_unparse.py b/Lib/test/test_unparse.py index 3e796860cbcf22..49767dbac16d11 100644 --- a/Lib/test/test_unparse.py +++ b/Lib/test/test_unparse.py @@ -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.