From 89c528b02d5fad6a211f3f9e6915677e1baa7806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Tue, 19 Sep 2000 16:22:10 +0000 Subject: Don't print specific Node instances unless running verbosely. Closes Bug #114775. --- Lib/test/output/test_minidom | 4 ++-- Lib/test/test_minidom.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Lib/test/output/test_minidom b/Lib/test/output/test_minidom index 2abb0ac..ca7fb7b 100644 --- a/Lib/test/output/test_minidom +++ b/Lib/test/output/test_minidom @@ -80,10 +80,10 @@ Test Succeeded testParseAttributeNamespaces Test Succeeded testParseAttributes Test Succeeded testParseElement Test Succeeded testParseElementNamespaces - +Passed Test Test Succeeded testParseFromFile Garbage left over: -[('168820100', "{'childNodes': []}"), ('168926628', "{'childNodes': []}"), ('168722260', "{'childNodes': []}"), ('168655020', "{'childNodes': []}"), ('168650868', "{'childNodes': []}"), ('168663308', "{'childNodes': []}"), ('168846892', "{'childNodes': []}"), ('169039972', "{'childNodes': []}"), ('168666508', "{'childNodes': []}"), ('168730780', "{'childNodes': []}")] +258 Test Succeeded testParseProcessingInstructions Test Succeeded testParseString Test Succeeded testProcessingInstruction diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py index 7cddf4b..bc62ec3 100644 --- a/Lib/test/test_minidom.py +++ b/Lib/test/test_minidom.py @@ -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 -- cgit v0.12