Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be287c3

Browse files
authored
Fix error when running with -uall in test_unparse (GH-17739)
1 parent 23a226b commit be287c3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Lib/test/test_unparse.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -303,17 +303,17 @@ def files_to_test(cls):
303303
if not item.name.startswith("bad")
304304
]
305305

306-
tests_to_run_always = {item for item in items if
307-
item.name in cls.run_always_files}
308-
309306
# Test limited subset of files unless the 'cpu' resource is specified.
310307
if not test.support.is_resource_enabled("cpu"):
311-
items = set(random.sample(items, 10))
312308

313-
# Make sure that at least tests that heavily use grammar features are
314-
# considered to reduce the change of missing something.
309+
tests_to_run_always = {item for item in items if
310+
item.name in cls.run_always_files}
311+
312+
items = set(random.sample(items, 10))
315313

316-
items = list(items | tests_to_run_always)
314+
# Make sure that at least tests that heavily use grammar features are
315+
# always considered in order to reduce the chance of missing something.
316+
items = list(items | tests_to_run_always)
317317

318318
# bpo-31174: Store the names sample to always test the same files.
319319
# It prevents false alarms when hunting reference leaks.

0 commit comments

Comments
 (0)