[Python-checkins] cpython (2.7): Some more tests were incorrectly marked as C specific.

ezio.melotti python-checkins at python.org
Mon May 9 17:42:46 CEST 2011


http://hg.python.org/cpython/rev/dd088470f090
changeset: 69982:dd088470f090
branch: 2.7
parent: 69970:6c7984bae459
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Mon May 09 18:32:18 2011 +0300
summary:
 Some more tests were incorrectly marked as C specific.
files:
 Lib/test/test_heapq.py | 27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/Lib/test/test_heapq.py b/Lib/test/test_heapq.py
--- a/Lib/test/test_heapq.py
+++ b/Lib/test/test_heapq.py
@@ -190,17 +190,8 @@
 self.assertEqual(self.module.nlargest(n, data, key=f),
 sorted(data, key=f, reverse=True)[:n])
 
-
-class TestHeapPython(TestHeap):
- module = py_heapq
-
-
- at 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__ and __le__
+ # Issue 3051: Make sure heapq works with both __lt__ and __le__
 def hsort(data, comp):
 data = map(comp, data)
 self.module.heapify(data)
@@ -221,6 +212,15 @@
 self.assertEqual(hsort(data, LE), target)
 
 
+class TestHeapPython(TestHeap):
+ module = py_heapq
+
+
+ at skipUnless(c_heapq, 'requires _heapq')
+class TestHeapC(TestHeap):
+ module = c_heapq
+
+
 #==============================================================================
 
 class LenOnly:
@@ -316,6 +316,7 @@
 return chain(imap(lambda x:x, R(Ig(G(seqn)))))
 
 class TestErrorHandling(TestCase):
+ module = None
 
 def test_non_sequence(self):
 for f in (self.module.heapify, self.module.heappop):
@@ -361,12 +362,12 @@
 self.assertRaises(ZeroDivisionError, f, 2, E(s))
 
 
-class TestErrorHandling_Python(TestErrorHandling):
+class TestErrorHandlingPython(TestErrorHandling):
 module = py_heapq
 
 
 @skipUnless(c_heapq, 'requires _heapq')
-class TestErrorHandling_C(TestErrorHandling):
+class TestErrorHandlingC(TestErrorHandling):
 module = c_heapq
 
 
@@ -375,7 +376,7 @@
 
 def test_main(verbose=None):
 test_classes = [TestModules, TestHeapPython, TestHeapC,
- TestErrorHandling_Python, TestErrorHandling_C]
+ TestErrorHandlingPython, TestErrorHandlingC]
 test_support.run_unittest(*test_classes)
 
 # verify reference counting
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /