[Python-checkins] CVS: python/dist/src/Lib/test test_minidom.py,1.9,1.10

Fred L. Drake python-dev@python.org
Mon, 9 Oct 2000 12:57:42 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv2487

Modified Files:
	test_minidom.py 
Log Message:

Move the test for confirmation that all nodes have been freed into the
driver code, so that each test gets this; it had been done inconsistently.
Remove the lines that set the variables holding dom objects to None; not
needed since the interpreter cleans up locals on function return.


Index: test_minidom.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_minidom.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** test_minidom.py	2000/10/06 22:42:54	1.9
--- test_minidom.py	2000/10/09 19:57:38	1.10
***************
*** 36,41 ****
              dom.documentElement.getElementsByTagName( "LI" ) )
      dom.unlink()
-     dom=None
-     confirm (len( Node.allnodes )==0)
  
  def testInsertBefore( ):
--- 36,39 ----
***************
*** 51,57 ****
      #confirm( docel.childNodes[2].tet=="a" )
      dom.unlink()
-     del dom
-     del docel
-     confirm( len( Node.allnodes )==0)
  
  def testAppendChild():
--- 49,52 ----
***************
*** 61,66 ****
      confirm( dom.documentElement.childNodes[-1].data=="Hello" )
      dom.unlink()
-     dom=None
-     confirm( len( Node.allnodes )==0 )
  
  def testNonZero():
--- 56,59 ----
***************
*** 70,81 ****
      confirm( not dom.childNodes[-1].childNodes )
      dom.unlink()
-     dom=None
-     confirm( len( Node.allnodes )==0 )
  
  def testUnlink():
      dom=parse( tstfile )
      dom.unlink()
-     dom=None
-     confirm( len( Node.allnodes )==0 )
  
  def testElement():
--- 63,70 ----
***************
*** 84,89 ****
      confirm( dom.documentElement )
      dom.unlink()
-     dom=None
-     confirm( len( Node.allnodes )==0 )
  
  def testAAA():
--- 73,76 ----
***************
*** 92,96 ****
      el.setAttribute( "spam", "jam2" )
      dom.unlink()
-     dom=None
  
  def testAAB():
--- 79,82 ----
***************
*** 100,104 ****
      el.setAttribute( "spam", "jam2" )
      dom.unlink()
-     dom=None
  
  def testAddAttr():
--- 86,89 ----
***************
*** 121,128 ****
  
      confirm( len( child.attributes )==2 )
- 
      dom.unlink()
-     dom=None
-     child=None
  
  def testDeleteAttr():
--- 106,110 ----
***************
*** 136,140 ****
      confirm( len( child.attributes)==0 )
      dom.unlink()
-     confirm( len( Node.allnodes )==0 )
  
  def testRemoveAttr():
--- 118,121 ----
***************
*** 161,165 ****
  
      dom.unlink()
-     dom=None
      
  def testRemoveAttributeNode():
--- 142,145 ----
***************
*** 173,178 ****
  
      dom.unlink()
-     dom=None
-     confirm( len( Node.allnodes )==0 )
  
  def testChangeAttr():
--- 153,156 ----
***************
*** 190,195 ****
      confirm( len( el.attributes )==2 )
      dom.unlink()
-     dom=None
-     confirm( len( Node.allnodes )==0 )
  
  def testGetAttrList():
--- 168,171 ----
***************
*** 237,240 ****
--- 213,217 ----
      confirm( string1.find("slash:abc" )!=-1 )
      dom.unlink()
+     confirm( len( Node.allnodes )==0 )
  
  def testAttributeRepr():
***************
*** 244,247 ****
--- 221,225 ----
      confirm( str( node ) == repr( node ) )
      dom.unlink()
+     confirm( len( Node.allnodes )==0 )
  
  def testTextNodeRepr(): pass
***************
*** 253,256 ****
--- 231,235 ----
      dom.unlink()
      confirm(str == domstr)
+     confirm( len( Node.allnodes )==0 )
  
  def testProcessingInstruction(): pass
***************
*** 342,345 ****
--- 321,326 ----
              func()
              print "Test Succeeded", name
+             confirm(len(Node.allnodes) == 0,
+                     "assertion: len(Node.allnodes) == 0")
              if len( Node.allnodes ):
                  print "Garbage left over:"