[Python-checkins] python/dist/src/Lib/test test_gc.py,1.12.10.1,1.12.10.2

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Wed, 12 Jun 2002 07:41:52 -0700


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

Modified Files:
      Tag: release22-maint
	test_gc.py 
Log Message:
Backport 1.15:

Add a testcase to ensure that cycles going through the __class__ link
of a new-style instance are detected by the garbage collector.


Index: test_gc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_gc.py,v
retrieving revision 1.12.10.1
retrieving revision 1.12.10.2
diff -C2 -d -r1.12.10.1 -r1.12.10.2
*** test_gc.py	28 Mar 2002 23:18:08 -0000	1.12.10.1
--- test_gc.py	12 Jun 2002 14:41:50 -0000	1.12.10.2
***************
*** 84,87 ****
--- 84,93 ----
      del a
      expect_nonzero(gc.collect(), "newinstance(2)")
+     del B, C
+     expect_nonzero(gc.collect(), "newinstance(3)")
+     A.a = A()
+     del A
+     expect_nonzero(gc.collect(), "newinstance(4)")
+     expect(gc.collect(), 0, "newinstance(5)")
  
  def test_method():