Commit 694781b1 authored by Benjamin Peterson's avatar Benjamin Peterson

must force gc here

parent 5b9ce31c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import unittest import unittest
from test.test_support import run_unittest, TESTFN, unlink, have_unicode, \ from test.test_support import run_unittest, TESTFN, unlink, have_unicode, \
check_py3k_warnings check_py3k_warnings, gc_collect
# Test result of triple loop (too big to inline) # Test result of triple loop (too big to inline)
TRIPLETS = [(0, 0, 0), (0, 0, 1), (0, 0, 2), TRIPLETS = [(0, 0, 0), (0, 0, 1), (0, 0, 2),
...@@ -807,6 +807,7 @@ class TestCase(unittest.TestCase): ...@@ -807,6 +807,7 @@ class TestCase(unittest.TestCase):
x = C() x = C()
self.assertEqual(C.count, 1) self.assertEqual(C.count, 1)
del x del x
gc_collect()
self.assertEqual(C.count, 0) self.assertEqual(C.count, 0)
l = [C(), C(), C()] l = [C(), C(), C()]
self.assertEqual(C.count, 3) self.assertEqual(C.count, 3)
...@@ -815,6 +816,7 @@ class TestCase(unittest.TestCase): ...@@ -815,6 +816,7 @@ class TestCase(unittest.TestCase):
except ValueError: except ValueError:
pass pass
del l del l
gc_collect()
self.assertEqual(C.count, 0) self.assertEqual(C.count, 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment