(original) (raw)
changeset: 77614:0e5a698d3c4c parent: 77610:aa153b827d17 user: Mark Dickinson mdickinson@enthought.com date: Sat Jun 23 09:27:47 2012 +0100 files: Lib/test/test_tools.py Tools/parser/test_unparse.py description: Issue #14742: test_unparse now only checks a limited number of files unless the 'cpu' resource is specified. diff -r aa153b827d17 -r 0e5a698d3c4c Lib/test/test_tools.py --- a/Lib/test/test_tools.py Fri Jun 22 22:49:12 2012 -0500 +++ b/Lib/test/test_tools.py Sat Jun 23 09:27:47 2012 +0100 @@ -127,6 +127,7 @@ # Run the tests in Tools/parser/test_unparse.py with support.DirsOnSysPath(os.path.join(basepath, 'parser')): from test_unparse import UnparseTestCase + from test_unparse import DirectoryTestCase def test_main(): diff -r aa153b827d17 -r 0e5a698d3c4c Tools/parser/test_unparse.py --- a/Tools/parser/test_unparse.py Fri Jun 22 22:49:12 2012 -0500 +++ b/Tools/parser/test_unparse.py Sat Jun 23 09:27:47 2012 +0100 @@ -2,9 +2,10 @@ import test.support import io import os +import random import tokenize +import unparse import ast -import unparse def read_pyfile(filename): """Read and return the contents of a Python source file (as a @@ -257,6 +258,10 @@ if n.endswith('.py') and not n.startswith('bad'): names.append(os.path.join(test_dir, n)) + # Test limited subset of files unless the 'cpu' resource is specified. + if not test.support.is_resource_enabled("cpu"): + names = random.sample(names, 10) + for filename in names: if test.support.verbose: print('Testing %s' % filename) /mdickinson@enthought.com