diff options
author | Gennadiy Civil <misterg@google.com> | 2018-01-22 20:20:19 (GMT) |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2018-01-22 20:20:19 (GMT) |
commit | f1c87ad9f518b86a1efc2a68f452aaf53b899bfe (patch) | |
tree | 897bbdf0751bea610e69771c54cd2e74b8510883 /googletest/test/gtest_xml_test_utils.py | |
parent | 9bc86661f86a5c946f9e0a29ea2e34c8a9897d6b (diff) | |
download | googletest-f1c87ad9f518b86a1efc2a68f452aaf53b899bfe.zip googletest-f1c87ad9f518b86a1efc2a68f452aaf53b899bfe.tar.gz googletest-f1c87ad9f518b86a1efc2a68f452aaf53b899bfe.tar.bz2 |
merges, cl/155419551 and other
Diffstat (limited to 'googletest/test/gtest_xml_test_utils.py')
-rwxr-xr-x | googletest/test/gtest_xml_test_utils.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/googletest/test/gtest_xml_test_utils.py b/googletest/test/gtest_xml_test_utils.py index 341956b..6694519 100755 --- a/googletest/test/gtest_xml_test_utils.py +++ b/googletest/test/gtest_xml_test_utils.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python -# # Copyright 2006, Google Inc. # All rights reserved. # @@ -31,12 +29,10 @@ """Unit test utilities for gtest_xml_output""" -__author__ = 'eefacm@gmail.com (Sean Mcafee)' - +import os import re -from xml.dom import minidom, Node - import gtest_test_utils +from xml.dom import minidom, Node GTEST_OUTPUT_FLAG = '--gtest_output' @@ -101,7 +97,7 @@ class GTestXMLTestCase(gtest_test_utils.TestCase): self.assertEquals( len(expected_children), len(actual_children), 'number of child elements differ in element ' + actual_node.tagName) - for child_id, child in expected_children.items(): + for child_id, child in expected_children.iteritems(): self.assert_(child_id in actual_children, '<%s> is not in <%s> (in element %s)' % (child_id, actual_children, actual_node.tagName)) @@ -187,8 +183,8 @@ class GTestXMLTestCase(gtest_test_utils.TestCase): # Replaces the source line information with a normalized form. cdata = re.sub(source_line_pat, '\\1*\n', child.nodeValue) # Removes the actual stack trace. - child.nodeValue = re.sub(r'\nStack trace:\n(.|\n)*', - '', cdata) + child.nodeValue = re.sub(r'Stack trace:\n(.|\n)*', + 'Stack trace:\n*', cdata) for child in element.childNodes: if child.nodeType == Node.ELEMENT_NODE: self.NormalizeXml(child) |