Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r59345:8be1ab0970fd
Date: 2012-12-05 17:21 -0800
http://bitbucket.org/pypy/pypy/changeset/8be1ab0970fd/
Log: gc_collects from 2.7
diff --git a/lib-python/3.2/test/test_weakref.py
b/lib-python/3.2/test/test_weakref.py
--- a/lib-python/3.2/test/test_weakref.py
+++ b/lib-python/3.2/test/test_weakref.py
@@ -1266,6 +1266,7 @@
libreftest = """ Doctest for examples in the library reference: weakref.rst
+>>> from test.support import gc_collect
>>> import weakref
>>> class Dict(dict):
... pass
@@ -1285,6 +1286,7 @@
>>> o is o2
True
>>> del o, o2
+>>> gc_collect()
>>> print(r())
None
diff --git a/lib-python/3.2/test/test_weakset.py
b/lib-python/3.2/test/test_weakset.py
--- a/lib-python/3.2/test/test_weakset.py
+++ b/lib-python/3.2/test/test_weakset.py
@@ -45,6 +45,7 @@
self.assertEqual(len(self.s), len(self.d))
self.assertEqual(len(self.fs), 1)
del self.obj
+ support.gc_collect()
self.assertEqual(len(self.fs), 0)
def test_contains(self):
@@ -54,6 +55,7 @@
self.assertNotIn(1, self.s)
self.assertIn(self.obj, self.fs)
del self.obj
+ support.gc_collect()
self.assertNotIn(ustr('F'), self.fs)
def test_union(self):
@@ -192,6 +194,7 @@
self.assertEqual(self.s, dup)
self.assertRaises(TypeError, self.s.add, [])
self.fs.add(Foo())
+ support.gc_collect()
self.assertTrue(len(self.fs) == 1)
self.fs.add(self.obj)
self.assertTrue(len(self.fs) == 1)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit