Run a more GC iterations to make sure weakrefs are collected

This is needed to make sure the weakref callback is fired under PyPy.

Change-Id: I5d1b83186780ee6130463fe42fac58e411ad9f79
This commit is contained in:
Alex Gaynor 2013-08-19 15:50:03 -07:00
parent 557bc32870
commit 85475b2fbd

View File

@ -4394,7 +4394,7 @@ class TestObjectController(unittest.TestCase):
self.assertEqual(headers[:len(exp)], exp)
# Remember Request instance count, make sure the GC is run for pythons
# without reference counting.
for i in xrange(3):
for i in xrange(4):
gc.collect()
before_request_instances = len(_request_instances)
# GET test file, but disconnect early
@ -4413,7 +4413,7 @@ class TestObjectController(unittest.TestCase):
fd.close()
sock.close()
# Make sure the GC is run again for pythons without reference counting
for i in xrange(3):
for i in xrange(4):
gc.collect()
self.assertEquals(before_request_instances, len(_request_instances))