[pypy-commit] pypy stdlib-3.2.5: Skip some implementation details.

amauryfa noreply at buildbot.pypy.org
Wed Apr 2 02:58:09 CEST 2014


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: stdlib-3.2.5
Changeset: r70390:ddc62d7d5716
Date: 2014-04-02 00:59 +0200
http://bitbucket.org/pypy/pypy/changeset/ddc62d7d5716/

Log:	Skip some implementation details. One remaining failure in
	test_weakref is suspect: __len__() returns -7!

diff --git a/lib-python/3/test/test_functools.py b/lib-python/3/test/test_functools.py
--- a/lib-python/3/test/test_functools.py
+++ b/lib-python/3/test/test_functools.py
@@ -197,9 +197,13 @@
                 raise IndexError
 
         f = self.thetype(object)
-        self.assertRaisesRegex(SystemError,
-                "new style getargs format but argument is not a tuple",
-                f.__setstate__, BadSequence())
+        if support.check_impl_detail(pypy=True):
+            # CPython fails, pypy does not :-)
+            f.__setstate__(BadSequence())
+        else:
+            self.assertRaisesRegex(SystemError,
+                    "new style getargs format but argument is not a tuple",
+                    f.__setstate__, BadSequence())
 
 class PartialSubclass(functools.partial):
     pass
diff --git a/lib-python/3/test/test_weakref.py b/lib-python/3/test/test_weakref.py
--- a/lib-python/3/test/test_weakref.py
+++ b/lib-python/3/test/test_weakref.py
@@ -934,6 +934,7 @@
         n1 = len(dct)
         del it
         gc.collect()
+        gc.collect()
         n2 = len(dct)
         # one item may be kept alive inside the iterator
         self.assertIn(n1, (0, 1))
@@ -945,6 +946,7 @@
     def test_weak_valued_len_cycles(self):
         self.check_len_cycles(weakref.WeakValueDictionary, lambda k: (1, k))
 
+    @support.impl_detail("PyPy has no cyclic collection", pypy=False)
     def check_len_race(self, dict_type, cons):
         # Extended sanity checks for len() in the face of cyclic collection
         self.addCleanup(gc.set_threshold, *gc.get_threshold())
diff --git a/lib-python/3/test/test_weakset.py b/lib-python/3/test/test_weakset.py
--- a/lib-python/3/test/test_weakset.py
+++ b/lib-python/3/test/test_weakset.py
@@ -406,11 +406,13 @@
         n1 = len(s)
         del it
         gc.collect()
+        gc.collect()
         n2 = len(s)
         # one item may be kept alive inside the iterator
         self.assertIn(n1, (0, 1))
         self.assertEqual(n2, 0)
 
+    @support.impl_detail("PyPy has no cyclic collection", pypy=False)
     def test_len_race(self):
         # Extended sanity checks for len() in the face of cyclic collection
         self.addCleanup(gc.set_threshold, *gc.get_threshold())


More information about the pypy-commit mailing list