1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-23 01:52:48 +03:00

update all tests for Python3 and Python2

This commit is contained in:
Daniel Veillard
2013-03-30 21:38:20 +08:00
parent 6f18465189
commit 2cb6bf8eb0
47 changed files with 535 additions and 474 deletions

14
python/tests/xpathleak.py Normal file → Executable file
View File

@@ -42,24 +42,24 @@ badexprs = (
for expr in badexprs:
try:
ctxt.xpathEval(expr)
except libxml2.xpathError, e:
except libxml2.xpathError as e:
pass
else:
print "Unexpectedly legal expression:", expr
print("Unexpectedly legal expression:", expr)
ctxt.xpathFreeContext()
doc.freeDoc()
if err != expect:
print "error"
print "received %s" %(err)
print "expected %s" %(expect)
print("error")
print("received %s" %(err))
print("expected %s" %(expect))
sys.exit(1)
libxml2.cleanupParser()
leakedbytes = libxml2.debugMemory(True)
if leakedbytes == 0:
print "OK"
print("OK")
else:
print "Memory leak", leakedbytes, "bytes"
print("Memory leak", leakedbytes, "bytes")
# drop file to .memdump file in cwd, but won't work if not compiled in
libxml2.dumpMemory()