Use the 'reverse' parameter of sorted() instead of 'mycmp'.

This commit is contained in:
Valentin Lorentz 2012-08-05 14:49:47 +02:00
parent a731841af8
commit 16aeaaa4fe
1 changed files with 1 additions and 3 deletions

View File

@ -145,9 +145,7 @@ class GenTest(SupyTestCase):
L = ['a', 'c', 'b']
self.assertEqual(sorted(L), ['a', 'b', 'c'])
self.assertEqual(L, ['a', 'c', 'b'])
def mycmp(x, y):
return -cmp(x, y)
self.assertEqual(sorted(L, mycmp), ['c', 'b', 'a'])
self.assertEqual(sorted(L, reverse=True), ['c', 'b', 'a'])
def testTimeElapsed(self):
self.assertRaises(ValueError, utils.timeElapsed, 0,