File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -268,12 +268,13 @@ class DirectoryTestCase(ASTTestCase):
268
268
# test directories, relative to the root of the distribution
269
269
test_directories = 'Lib' , os .path .join ('Lib' , 'test' )
270
270
271
- def get_names (self ):
272
- if DirectoryTestCase .NAMES is not None :
273
- return DirectoryTestCase .NAMES
271
+ @classmethod
272
+ def get_names (cls ):
273
+ if cls .NAMES is not None :
274
+ return cls .NAMES
274
275
275
276
names = []
276
- for d in self .test_directories :
277
+ for d in cls .test_directories :
277
278
test_dir = os .path .join (basepath , d )
278
279
for n in os .listdir (test_dir ):
279
280
if n .endswith ('.py' ) and not n .startswith ('bad' ):
@@ -282,10 +283,9 @@ def get_names(self):
282
283
# Test limited subset of files unless the 'cpu' resource is specified.
283
284
if not test .support .is_resource_enabled ("cpu" ):
284
285
names = random .sample (names , 10 )
285
- # bpo-31174: Store the names sample to always test the same files.
286
- # It prevents false alarms when hunting reference leaks.
287
- DirectoryTestCase .NAMES = names
288
-
286
+ # bpo-31174: Store the names sample to always test the same files.
287
+ # It prevents false alarms when hunting reference leaks.
288
+ cls .NAMES = names
289
289
return names
290
290
291
291
def test_files (self ):
You can’t perform that action at this time.
0 commit comments