We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e59c9d9 commit 006aedeCopy full SHA for 006aede
1 file changed
tests/common.py
@@ -15,13 +15,25 @@
15
import os
16
import shutil
17
import random
18
+import re
19
20
21
def check_report(report_file, tests=None):
22
"""
23
Check an XML report_file for the exact occurrence of specific test results
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
37
root = tree.getroot()
38
report = {}
39
for test in root.iter("testcase"):
0 commit comments