|
|
|
@ -13,8 +13,6 @@ |
|
|
|
|
# limitations under the License. |
|
|
|
|
"""Generate XML and HTML test reports.""" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
from mako.runtime import Context |
|
|
|
|
from mako.template import Template |
|
|
|
@ -33,7 +31,9 @@ def _filter_msg(msg, output_format): |
|
|
|
|
if output_format in ['XML', 'HTML']: |
|
|
|
|
# keep whitespaces but remove formfeed and vertical tab characters |
|
|
|
|
# that make XML report unparseable. |
|
|
|
|
filtered_msg = [x for x in msg.decode('UTF-8', 'ignore') if x in string.printable and x != '\f' and x != '\v'] |
|
|
|
|
filtered_msg = filter( |
|
|
|
|
lambda x: x in string.printable and x != '\f' and x != '\v', |
|
|
|
|
msg.decode('UTF-8', 'ignore')) |
|
|
|
|
if output_format == 'HTML': |
|
|
|
|
filtered_msg = filtered_msg.replace('"', '"') |
|
|
|
|
return filtered_msg |
|
|
|
|