diff options
author | Raymond Hettinger <python@rcn.com> | 2005-06-19 05:53:15 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2005-06-19 05:53:15 (GMT) |
commit | 8f7dce605fefb605da4c732bdaffd01e5246362a (patch) | |
tree | 68404535b628089518b4b659468bc97eda9c23df /Lib | |
parent | d1d13eb9725c7333b5c9cbc62d9f39771422c781 (diff) | |
download | cpython-8f7dce605fefb605da4c732bdaffd01e5246362a.zip cpython-8f7dce605fefb605da4c732bdaffd01e5246362a.tar.gz cpython-8f7dce605fefb605da4c732bdaffd01e5246362a.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 |