Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __add__(self, other):
if self == other:
# Merge the two suites
result = deepcopy(self)
for case in other:
result._add_testcase_no_update_stats(case)
for suite in other.testsuites():
result.add_testsuite(suite)
result.update_statistics()
else:
# Create a new test result containing two suites
result = JUnitXml()
result.add_testsuite(self)
result.add_testsuite(other)
return result
def __iadd__(self, other):
if self == other:
for case in other:
self._add_testcase_no_update_stats(case)
for suite in other.testsuites():
self.add_testsuite(suite)
self.update_statistics()
return self
else:
result = JUnitXml()
result.filepath = self.filepath
result.add_testsuite(self)
result.add_testsuite(other)
return result
def __add__(self, other):
result = JUnitXml()
for suite in self:
result.add_testsuite(suite)
for suite in other:
result.add_testsuite(suite)
return result
def __add__(self, other):
if self == other:
# Merge the two suites
result = deepcopy(self)
for case in other:
result._add_testcase_no_update_stats(case)
for suite in other.testsuites():
result.add_testsuite(suite)
result.update_statistics()
else:
# Create a new test result containing two suites
result = JUnitXml()
result.add_testsuite(self)
result.add_testsuite(other)
return result
def __init__(self, name=None):
super(JUnitXml, self).__init__(self._tag)
self.filepath = None
self.name = name
def __iadd__(self, other):
if self == other:
for case in other:
self._add_testcase_no_update_stats(case)
for suite in other.testsuites():
self.add_testsuite(suite)
self.update_statistics()
return self
else:
result = JUnitXml()
result.filepath = self.filepath
result.add_testsuite(self)
result.add_testsuite(other)
return result
def __add__(self, other):
result = JUnitXml()
for suite in self:
result.add_testsuite(suite)
for suite in other:
result.add_testsuite(suite)
return result