add gc_collects to weakref tests

This commit is contained in:
Philip Jenvey 2012-11-13 12:26:31 -08:00
parent cc7715f8ae
commit 3acc7ef1c5

View file

@ -493,6 +493,7 @@ def inner_raising_func():
e.__context__ = None
obj = None
obj = wr()
gc_collect()
self.assertTrue(obj is None, "%s" % obj)
# Some complicated construct
@ -509,6 +510,7 @@ def inner_raising_func():
except MyException:
pass
obj = None
gc_collect()
obj = wr()
self.assertTrue(obj is None, "%s" % obj)
@ -523,6 +525,7 @@ def __exit__ (self, exc_type, exc_value, exc_tb):
with Context():
inner_raising_func()
obj = None
gc_collect()
obj = wr()
self.assertTrue(obj is None, "%s" % obj)