Commits

illume  committed a641603

Another python2.3 fixup for the test code.

  • Participants
  • Parent commits 3a44587

Comments (0)

Files changed (1)

File test/test_utils/unittest.py

 __all__.extend(['getTestCaseNames', 'makeSuite', 'findTestCases'])
 
 
+
+
+def _sort_using_key(seq, key_func):
+    deco = [ (key_func(word), i, word) for i, word in enumerate(seq) ]
+    deco.sort()
+    new_words = [ word for _, _, word in deco ]
+    return new_words
+
+
 ##############################################################################
 # Backward compatibility
 ##############################################################################
                 if testFnName not in testFnNames:  # handle overridden methods
                     testFnNames.append(testFnName)
         if self.sortTestMethodsUsing:
-            testFnNames.sort(key=CmpToKey(self.sortTestMethodsUsing))
+            #testFnNames.sort(key=CmpToKey(self.sortTestMethodsUsing))
+            testFnNames = _sort_using_key(testFnNames, CmpToKey(self.sortTestMethodsUsing))
         return testFnNames
 
 
 
+
+
 defaultTestLoader = TestLoader()