summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-12-29 20:18:36 (GMT)
committerGitHub <noreply@github.com>2019-12-29 20:18:36 (GMT)
commitbe287c319124b7eb59ef32b69cf837ae3e99acab (patch)
treee0c9c00daa3cf883d97db8c18458af1770dea48f /Lib
parent23a226bf3ae7b462084e899d007d12d9fe398ac5 (diff)
downloadcpython-be287c319124b7eb59ef32b69cf837ae3e99acab.zip
cpython-be287c319124b7eb59ef32b69cf837ae3e99acab.tar.gz
cpython-be287c319124b7eb59ef32b69cf837ae3e99acab.tar.bz2
Fix error when running with -uall in test_unparse (GH-17739)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_unparse.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_unparse.py b/Lib/test/test_unparse.py
index 3e79686..49767db 100644
--- a/Lib/test/test_unparse.py
+++ b/Lib/test/test_unparse.py
@@ -303,17 +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 = 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.