[Python-checkins] python/dist/src/Lib/test test_gc.py,1.20,1.21

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Sat, 10 Aug 2002 14:29:58 -0700


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

Modified Files:
	test_gc.py 
Log Message:
test_saveall():  Simplified a little, given that we only expect one item
in gc.garbage (so no need to loop looking for it -- it's there or it's
not).


Index: test_gc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_gc.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** test_gc.py	10 Aug 2002 21:20:54 -0000	1.20
--- test_gc.py	10 Aug 2002 21:29:56 -0000	1.21
***************
*** 181,194 ****
      id_l = id(l)
      del l
      gc.collect()
-     vereq(len(gc.garbage), 1)
      try:
!         for obj in gc.garbage:
!             if id(obj) == id_l:
!                 del obj[:]
!                 break
          else:
              raise TestFailed, "didn't find obj in garbage (saveall)"
-         gc.garbage.remove(obj)
      finally:
          gc.set_debug(debug)
--- 181,192 ----
      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)