[Python-checkins] python/dist/src/Lib/test test_gc.py,1.22,1.23

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Sat, 10 Aug 2002 21:15:11 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv15229/python/Lib/test

Modified Files:
	test_gc.py 
Log Message:
test_saveall():  Another small simplification; plus s/l/L/g.
test_del(), test_del_newclass():  No need to use apply() in these.


Index: test_gc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_gc.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** test_gc.py	10 Aug 2002 21:32:16 -0000	1.22
--- test_gc.py	11 Aug 2002 04:15:09 -0000	1.23
***************
*** 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():
--- 175,191 ----
      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)
!     obj = gc.garbage.pop()
!     vereq(id(obj), id_L)
  
  def test_del():
***************
*** 204,208 ****
  
      gc.disable()
!     apply(gc.set_threshold, thresholds)
  
  def test_del_newclass():
--- 202,206 ----
  
      gc.disable()
!     gc.set_threshold(*thresholds)
  
  def test_del_newclass():
***************
*** 219,223 ****
  
      gc.disable()
!     apply(gc.set_threshold, thresholds)
  
  class Ouch:
--- 217,221 ----
  
      gc.disable()
!     gc.set_threshold(*thresholds)
  
  class Ouch: