Don't print specific Node instances unless running verbosely.
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 19 Sep 2000 16:22:10 +0000 (16:22 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 19 Sep 2000 16:22:10 +0000 (16:22 +0000)
Closes Bug #114775.

Lib/test/output/test_minidom
Lib/test/test_minidom.py

index 2abb0ac2dc39ccea95b6162faa587d2706eedbe5..ca7fb7bb4f6883d0a8e7c5cff6f5a5b2a60acdc2 100644 (file)
@@ -80,10 +80,10 @@ Test Succeeded testParseAttributeNamespaces
 Test Succeeded testParseAttributes
 Test Succeeded testParseElement
 Test Succeeded testParseElementNamespaces
-<xml.dom.minidom.Document instance at 0xa104c8c>
+Passed Test
 Test Succeeded testParseFromFile
 Garbage left over:
-[('168820100<class xml.dom.minidom.Element at 0xa0cc58c>', "{'childNodes': []}"), ('168926628<class xml.dom.minidom.Text at 0xa0ccfac>', "{'childNodes': []}"), ('168722260<class xml.dom.minidom.Text at 0xa0ccfac>', "{'childNodes': []}"), ('168655020<class xml.dom.minidom.Text at 0xa0ccfac>', "{'childNodes': []}"), ('168650868<class xml.dom.minidom.Text at 0xa0ccfac>', "{'childNodes': []}"), ('168663308<class xml.dom.minidom.Text at 0xa0ccfac>', "{'childNodes': []}"), ('168846892<class xml.dom.minidom.Text at 0xa0ccfac>', "{'childNodes': []}"), ('169039972<class xml.dom.minidom.Text at 0xa0ccfac>', "{'childNodes': []}"), ('168666508<class xml.dom.minidom.Element at 0xa0cc58c>', "{'childNodes': []}"), ('168730780<class xml.dom.minidom.Element at 0xa0cc58c>', "{'childNodes': []}")]
+258
 Test Succeeded testParseProcessingInstructions
 Test Succeeded testParseString
 Test Succeeded testProcessingInstruction
index 7cddf4b6fd9da3b042191049c12f3a3f65b7096a..bc62ec3b43598ba877e2f4d3c85468f75d2beaee 100644 (file)
@@ -5,6 +5,7 @@ from xml.dom.minidom import parse, Node, Document, parseString
 import os.path
 import sys
 import traceback
+from test_support import verbose
 
 if __name__ == "__main__":
     base = sys.argv[0]
@@ -25,7 +26,7 @@ Node._debug=1
 def testParseFromFile():
     from StringIO import StringIO
     dom=parse( StringIO( open( tstfile ).read() ) )
-    print dom
+    confirm(isinstance(dom,Document))
 
 def testGetElementsByTagName( ):
     dom=parse( tstfile )
@@ -335,7 +336,12 @@ for name in names:
             print "Test Succeeded", name
             if len( Node.allnodes ):
                 print "Garbage left over:"
-                print Node.allnodes.items()[0:10]
+                if verbose:
+                    print Node.allnodes.items()[0:10]
+                else:
+                    # Don't print specific nodes if repeatable results
+                    # are needed
+                    print len(Node.allnodes)
             Node.allnodes={}
         except Exception, e :
             works=0