mirror of
https://github.com/python/cpython.git
synced 2025-12-11 03:20:01 +00:00
If PyXML is installed, there is no Node.allnodes, so that portion of
the test should be skipped if that's the case.
This commit is contained in:
parent
d2909c901e
commit
6dd7d07aa6
1 changed files with 22 additions and 11 deletions
|
|
@ -618,22 +618,33 @@ names.sort()
|
||||||
|
|
||||||
failed = []
|
failed = []
|
||||||
|
|
||||||
|
try:
|
||||||
|
Node.allnodes
|
||||||
|
except AttributeError:
|
||||||
|
# We don't actually have the minidom from teh standard library,
|
||||||
|
# but are picking up the PyXML version from site-packages.
|
||||||
|
def check_allnodes():
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
def check_allnodes():
|
||||||
|
confirm(len(Node.allnodes) == 0,
|
||||||
|
"assertion: len(Node.allnodes) == 0")
|
||||||
|
if len(Node.allnodes):
|
||||||
|
print "Garbage left over:"
|
||||||
|
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 = {}
|
||||||
|
|
||||||
for name in names:
|
for name in names:
|
||||||
if name.startswith("test"):
|
if name.startswith("test"):
|
||||||
func = globals()[name]
|
func = globals()[name]
|
||||||
try:
|
try:
|
||||||
func()
|
func()
|
||||||
confirm(len(Node.allnodes) == 0,
|
check_allnodes()
|
||||||
"assertion: len(Node.allnodes) == 0")
|
|
||||||
if len(Node.allnodes):
|
|
||||||
print "Garbage left over:"
|
|
||||||
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:
|
except:
|
||||||
failed.append(name)
|
failed.append(name)
|
||||||
print "Test Failed: ", name
|
print "Test Failed: ", name
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue