mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Use the 'reverse' parameter of sorted() instead of 'mycmp'.
This commit is contained in:
parent
a731841af8
commit
16aeaaa4fe
@ -145,9 +145,7 @@ class GenTest(SupyTestCase):
|
|||||||
L = ['a', 'c', 'b']
|
L = ['a', 'c', 'b']
|
||||||
self.assertEqual(sorted(L), ['a', 'b', 'c'])
|
self.assertEqual(sorted(L), ['a', 'b', 'c'])
|
||||||
self.assertEqual(L, ['a', 'c', 'b'])
|
self.assertEqual(L, ['a', 'c', 'b'])
|
||||||
def mycmp(x, y):
|
self.assertEqual(sorted(L, reverse=True), ['c', 'b', 'a'])
|
||||||
return -cmp(x, y)
|
|
||||||
self.assertEqual(sorted(L, mycmp), ['c', 'b', 'a'])
|
|
||||||
|
|
||||||
def testTimeElapsed(self):
|
def testTimeElapsed(self):
|
||||||
self.assertRaises(ValueError, utils.timeElapsed, 0,
|
self.assertRaises(ValueError, utils.timeElapsed, 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user