Skip to content

Commit 006aede

Browse files
committed
Debug
1 parent e59c9d9 commit 006aede

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

tests/common.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,25 @@
1515
import os
1616
import shutil
1717
import random
18+
import re
1819

1920

2021
def check_report(report_file, tests=None):
2122
"""
2223
Check an XML report_file for the exact occurrence of specific test results
2324
"""
24-
tree = ElementTree.parse(report_file)
25+
26+
xml_report = Path(report_file).read_text()
27+
illegal_xml_re = re.compile(r"[\x00-\x08\x0B\x0C\x0E-\x1F]")
28+
xml_report = illegal_xml_re.sub("", xml_report)
29+
Path(report_file).write_text(xml_report)
30+
31+
try:
32+
tree = ElementTree.parse(report_file)
33+
except ElementTree.ParseError:
34+
print(Path(report_file).read_text())
35+
raise
36+
2537
root = tree.getroot()
2638
report = {}
2739
for test in root.iter("testcase"):

0 commit comments

Comments
 (0)