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:
14
python/tests/xpathleak.py
Normal file → Executable file
14
python/tests/xpathleak.py
Normal file → Executable 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()
|
||||
|
||||
Reference in New Issue
Block a user