Revise the driver code to be more informative in the final report.

This commit is contained in:
Fred Drake 2001-02-01 18:11:29 +00:00
parent d0946da701
commit acfb3f6006
1 changed files with 10 additions and 7 deletions

View File

@ -500,7 +500,7 @@ def testSAX2DOM():
names = globals().keys()
names.sort()
works = 1
failed = []
for name in names:
if name.startswith("test"):
@ -519,18 +519,21 @@ for name in names:
# are needed
print len(Node.allnodes)
Node.allnodes = {}
except Exception, e:
works = 0
except:
failed.append(name)
print "Test Failed: ", name
sys.stdout.flush()
traceback.print_exception(*sys.exc_info())
print `e`
print `sys.exc_info()[1]`
Node.allnodes = {}
if works:
print "All tests succeeded"
if failed:
print "\n\n\n**** Check for failures in these tests:"
for name in failed:
print " " + name
print
else:
print "\n\n\n\n************ Check for failures!"
print "All tests succeeded"
Node.debug = None # Delete debug output collected in a StringIO object
Node._debug = 0 # And reset debug mode