mirror of
https://github.com/python/cpython.git
synced 2025-10-03 13:45:29 +00:00
add gc_collects to weakref tests
This commit is contained in:
parent
cc7715f8ae
commit
3acc7ef1c5
1 changed files with 3 additions and 0 deletions
|
@ -493,6 +493,7 @@ class ExceptionTests(unittest.TestCase):
|
||||||
e.__context__ = None
|
e.__context__ = None
|
||||||
obj = None
|
obj = None
|
||||||
obj = wr()
|
obj = wr()
|
||||||
|
gc_collect()
|
||||||
self.assertTrue(obj is None, "%s" % obj)
|
self.assertTrue(obj is None, "%s" % obj)
|
||||||
|
|
||||||
# Some complicated construct
|
# Some complicated construct
|
||||||
|
@ -509,6 +510,7 @@ class ExceptionTests(unittest.TestCase):
|
||||||
except MyException:
|
except MyException:
|
||||||
pass
|
pass
|
||||||
obj = None
|
obj = None
|
||||||
|
gc_collect()
|
||||||
obj = wr()
|
obj = wr()
|
||||||
self.assertTrue(obj is None, "%s" % obj)
|
self.assertTrue(obj is None, "%s" % obj)
|
||||||
|
|
||||||
|
@ -523,6 +525,7 @@ class ExceptionTests(unittest.TestCase):
|
||||||
with Context():
|
with Context():
|
||||||
inner_raising_func()
|
inner_raising_func()
|
||||||
obj = None
|
obj = None
|
||||||
|
gc_collect()
|
||||||
obj = wr()
|
obj = wr()
|
||||||
self.assertTrue(obj is None, "%s" % obj)
|
self.assertTrue(obj is None, "%s" % obj)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue