[pypy-commit] pypy py3.5: fix next test

arigo pypy.commits at gmail.com
Sun Jan 15 06:28:15 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r89578:31c1ed35e78b
Date: 2017-01-15 12:27 +0100
http://bitbucket.org/pypy/pypy/changeset/31c1ed35e78b/

Log:	fix next test

diff --git a/lib-python/3/test/test_finalization.py b/lib-python/3/test/test_finalization.py
--- a/lib-python/3/test/test_finalization.py
+++ b/lib-python/3/test/test_finalization.py
@@ -209,8 +209,15 @@
             self.assert_survivors(ids)
             self.clear_survivors()
             gc.collect()
-            self.assert_del_calls(ids * 2)
-            self.assert_survivors(ids)
+            if support.check_impl_detail():
+                # CPython: the __del__ method has been called again
+                self.assert_del_calls(ids * 2)
+                self.assert_survivors(ids)
+            else:
+                # PyPy (and likely others): the __del__ method is only
+                # called once
+                self.assert_del_calls(ids)
+                self.assert_survivors([])
 
 
 class SelfCycleBase:


More information about the pypy-commit mailing list