mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
Forward port total_ordering() and cmp_to_key().
This commit is contained in:
parent
5daab45158
commit
c50846aaef
10 changed files with 186 additions and 25 deletions
|
@ -5,6 +5,7 @@ import re
|
|||
import sys
|
||||
import traceback
|
||||
import types
|
||||
import functools
|
||||
|
||||
from fnmatch import fnmatch
|
||||
|
||||
|
@ -141,7 +142,7 @@ class TestLoader(object):
|
|||
testFnNames = testFnNames = list(filter(isTestMethod,
|
||||
dir(testCaseClass)))
|
||||
if self.sortTestMethodsUsing:
|
||||
testFnNames.sort(key=util.CmpToKey(self.sortTestMethodsUsing))
|
||||
testFnNames.sort(key=functools.cmp_to_key(self.sortTestMethodsUsing))
|
||||
return testFnNames
|
||||
|
||||
def discover(self, start_dir, pattern='test*.py', top_level_dir=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue