Commit c9d8873d authored by Mathieu Giraud's avatar Mathieu Giraud

src/should.py: pretty-print .xml output

parent 409bb934
Pipeline #51384 passed with stages
in 11 seconds
......@@ -37,6 +37,7 @@ import random
import os.path
from collections import defaultdict, OrderedDict
import xml.etree.ElementTree as ET
import xml.dom.minidom as minidom
import datetime
# Make sure the output is in utf8
......@@ -930,7 +931,10 @@ class FileSet():
print('==== interrupted ====\n')
if output and OUT_XML in output:
self.xml().write(OUT_XML)
s = ET.tostring(self.xml(), encoding='unicode', method='xml')
s = minidom.parseString(s).toprettyxml(indent=" ")
with open(OUT_XML, 'w') as f:
f.write(s)
print('Summary', end=' ')
print(self.stats.str_status(self.status))
......@@ -957,7 +961,7 @@ class FileSet():
for s in self.sets:
x.append(s.xml())
return ET.ElementTree(x)
return x
def write_retry(self, argv, argv_remove, verbose=1):
'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment