diff options
author | Raymond Hettinger <python@rcn.com> | 2005-06-18 21:00:26 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2005-06-18 21:00:26 (GMT) |
commit | bb999b5925ae65d19282c3781cdbb678f92c410f (patch) | |
tree | 72801517d3a84fe2b1620612142c9699d8bf564d /Lib | |
parent | f33f5e9d6efc1948da0f1d780837cf23d465c344 (diff) | |
download | cpython-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')
-rw-r--r-- | Lib/test/test_set.py | 10 |
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 |