[pypy-svn] pypy fast-forward: (lac, arigo)

arigo commits-noreply at bitbucket.org
Sun Jan 16 19:23:25 CET 2011

Author: Armin Rigo <arigo at tunes.org>
Branch: fast-forward
Changeset: r40729:2368e7efd42e
Date: 2011-01-16 17:32 +0100

Log:	(lac, arigo)

	If _heapq if not compiled, CPython fails 5 of these tests (exactly
	like PyPy). So change test_heapq to not run all tests that check
	explicitly the _heapq module.

diff --git a/lib-python/2.7.0/test/test_heapq.py b/lib-python/modified-2.7.0/test/test_heapq.py
copy from lib-python/2.7.0/test/test_heapq.py
copy to lib-python/modified-2.7.0/test/test_heapq.py
--- a/lib-python/2.7.0/test/test_heapq.py
+++ b/lib-python/modified-2.7.0/test/test_heapq.py
@@ -8,6 +8,8 @@
 # We do a bit of trickery here to be able to test both the C implementation
 # and the Python implementation of the module.
 import heapq as c_heapq
+if '_heapq' not in sys.modules:
+    c_heapq = None    # we don't have a _heapq module to test at all
 py_heapq = test_support.import_fresh_module('heapq', blocked=['_heapq'])
 class TestHeap(unittest.TestCase):
@@ -362,7 +364,9 @@
 def test_main(verbose=None):
-    test_classes = [TestHeapPython, TestHeapC, TestErrorHandling]
+    test_classes = [TestHeapPython]
+    if c_heapq is not None:
+        test_classes += [TestHeapC, TestErrorHandling]
     # verify reference counting

More information about the Pypy-commit mailing list