[Python-checkins] python/dist/src/Lib/test test_gc.py,1.21,1.22
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Sat, 10 Aug 2002 14:32:19 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv10743/python/Lib/test
Modified Files:
test_gc.py
Log Message:
And one more simplification to test_saveall().
Index: test_gc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_gc.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** test_gc.py 10 Aug 2002 21:29:56 -0000 1.21
--- test_gc.py 10 Aug 2002 21:32:16 -0000 1.22
***************
*** 175,194 ****
vereq(gc.garbage, []) # if this fails, someone else created immortal trash
- debug = gc.get_debug()
- gc.set_debug(debug | gc.DEBUG_SAVEALL)
l = []
l.append(l)
id_l = id(l)
- del l
gc.collect()
! try:
! vereq(len(gc.garbage), 1)
! if id(gc.garbage[0]) == id_l:
! del gc.garbage[0]
! else:
! raise TestFailed, "didn't find obj in garbage (saveall)"
! finally:
! gc.set_debug(debug)
def test_del():
--- 175,193 ----
vereq(gc.garbage, []) # if this fails, someone else created immortal trash
l = []
l.append(l)
id_l = id(l)
+ debug = gc.get_debug()
+ gc.set_debug(debug | gc.DEBUG_SAVEALL)
+ del l
gc.collect()
! gc.set_debug(debug)
!
! vereq(len(gc.garbage), 1)
! if id(gc.garbage[0]) == id_l:
! del gc.garbage[0]
! else:
! raise TestFailed, "didn't find obj in garbage (saveall)"
def test_del():