summaryrefslogtreecommitdiffstats
path: root/googletest/test/gtest_xml_test_utils.py
diff options
context:
space:
mode:
authorGennadiy Civil <misterg@google.com>2018-01-22 15:20:19 -0500
committerGennadiy Civil <misterg@google.com>2018-01-22 15:20:19 -0500
commitf1c87ad9f518b86a1efc2a68f452aaf53b899bfe (patch)
tree897bbdf0751bea610e69771c54cd2e74b8510883 /googletest/test/gtest_xml_test_utils.py
parent9bc86661f86a5c946f9e0a29ea2e34c8a9897d6b (diff)
downloadgoogletest-f1c87ad9f518b86a1efc2a68f452aaf53b899bfe.tar.gz
googletest-f1c87ad9f518b86a1efc2a68f452aaf53b899bfe.zip
merges, cl/155419551 and other
Diffstat (limited to 'googletest/test/gtest_xml_test_utils.py')
-rwxr-xr-xgoogletest/test/gtest_xml_test_utils.py14
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 341956b5..6694519b 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)
OpenPOWER on IntegriCloud