]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Some more tests were incorrectly marked as C specific.
authorEzio Melotti <ezio.melotti@gmail.com>
Mon, 9 May 2011 15:36:53 +0000 (18:36 +0300)
committerEzio Melotti <ezio.melotti@gmail.com>
Mon, 9 May 2011 15:36:53 +0000 (18:36 +0300)
Lib/test/test_heapq.py

index 3016c301a1fa87ea000e3367690e7657209f96be..9682f6e20068847d0840340756e19231f787fa18 100644 (file)
@@ -191,17 +191,8 @@ class TestHeap(TestCase):
                 self.assertEqual(list(self.module.nlargest(n, data, key=f)),
                                  sorted(data, key=f, reverse=True)[:n])
 
-
-class TestHeapPython(TestHeap):
-    module = py_heapq
-
-
-@skipUnless(c_heapq, 'requires _heapq')
-class TestHeapC(TestHeap):
-    module = c_heapq
-
     def test_comparison_operator(self):
-        # Issue 3501: Make sure heapq works with both __lt__
+        # Issue 3051: Make sure heapq works with both __lt__
         # For python 3.0, __le__ alone is not enough
         def hsort(data, comp):
             data = [comp(x) for x in data]
@@ -223,6 +214,15 @@ class TestHeapC(TestHeap):
         self.assertRaises(TypeError, data, LE)
 
 
+class TestHeapPython(TestHeap):
+    module = py_heapq
+
+
+@skipUnless(c_heapq, 'requires _heapq')
+class TestHeapC(TestHeap):
+    module = c_heapq
+
+
 #==============================================================================
 
 class LenOnly:
@@ -377,8 +377,6 @@ class TestErrorHandling(TestCase):
 
 
 def test_main(verbose=None):
-    from types import BuiltinFunctionType
-
     test_classes = [TestModules, TestHeapPython, TestHeapC, TestErrorHandling]
     support.run_unittest(*test_classes)