File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ def test_gprof(self):
127127# Run the tests in Tools/parser/test_unparse.py
128128with support .DirsOnSysPath (os .path .join (basepath , 'parser' )):
129129 from test_unparse import UnparseTestCase
130+ from test_unparse import DirectoryTestCase
130131
131132
132133def test_main ():
Original file line number Diff line number Diff line change 22import test .support
33import io
44import os
5+ import random
56import tokenize
6- import ast
77import unparse
8+ import ast
89
910def read_pyfile (filename ):
1011 """Read and return the contents of a Python source file (as a
@@ -257,6 +258,10 @@ def test_files(self):
257258 if n .endswith ('.py' ) and not n .startswith ('bad' ):
258259 names .append (os .path .join (test_dir , n ))
259260
261+ # Test limited subset of files unless the 'cpu' resource is specified.
262+ if not test .support .is_resource_enabled ("cpu" ):
263+ names = random .sample (names , 10 )
264+
260265 for filename in names :
261266 if test .support .verbose :
262267 print ('Testing %s' % filename )
You can’t perform that action at this time.
0 commit comments