From 16aeaaa4fe62a96b16544a041009e4894473db06 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 5 Aug 2012 14:49:47 +0200 Subject: [PATCH] Use the 'reverse' parameter of sorted() instead of 'mycmp'. --- test/test_utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/test_utils.py b/test/test_utils.py index 57f3e13dc..d047c19d7 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -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,