summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_set.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2005-06-18 21:00:26 (GMT)
committerRaymond Hettinger <python@rcn.com>2005-06-18 21:00:26 (GMT)
commitbb999b5925ae65d19282c3781cdbb678f92c410f (patch)
tree72801517d3a84fe2b1620612142c9699d8bf564d /Lib/test/test_set.py
parentf33f5e9d6efc1948da0f1d780837cf23d465c344 (diff)
downloadcpython-bb999b5925ae65d19282c3781cdbb678f92c410f.zip
cpython-bb999b5925ae65d19282c3781cdbb678f92c410f.tar.gz
cpython-bb999b5925ae65d19282c3781cdbb678f92c410f.tar.bz2
SF patch #1200018: Restore GC support to set objects
Reverts 1.26 and 1.27. And adds cycle testing.
Diffstat (limited to 'Lib/test/test_set.py')
-rw-r--r--Lib/test/test_set.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 900d8e4..26e38ab 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -202,6 +202,16 @@ class TestJointOps(unittest.TestCase):
self.assertNotEqual(id(t), id(newt))
self.assertEqual(t.value + 1, newt.value)
+ def test_gc(self):
+ # Create a nest of cycles to exercise overall ref count check
+ class A:
+ pass
+ s = set(A() for i in xrange(1000))
+ for elem in s:
+ elem.cycle = s
+ elem.sub = elem
+ elem.set = set([elem])
+
class TestSet(TestJointOps):
thetype = set