reintroduce junitxml report order and debug cleanups

This commit is contained in:
Ronny Pfannschmidt 2015-10-10 19:35:58 +02:00
parent 0528e5b45f
commit 5f5a7995b9
2 changed files with 4 additions and 4 deletions

View File

@ -132,8 +132,6 @@ class _NodeReporter(object):
tag = getattr(Junit, 'system-' + capname)
self.append(tag(bin_xml_escape(allcontent)))
def append_pass(self, report):
self.add_stats('passed')
self._write_captured_output(report)
@ -257,6 +255,7 @@ class LogXML(object):
'skipped',
], 0)
self.nodereporters = {} # nodeid -> _NodeReporter
self.nodereporters_ordered = []
def nodereporter(self, nodeid):
if nodeid in self.nodereporters:
@ -264,6 +263,7 @@ class LogXML(object):
return self.nodereporters[nodeid]
reporter = _NodeReporter(nodeid, self)
self.nodereporters[nodeid] = reporter
self.nodereporters_ordered.append(reporter)
return reporter
def add_stats(self, key):
@ -348,7 +348,7 @@ class LogXML(object):
logfile.write('<?xml version="1.0" encoding="utf-8"?>')
logfile.write(Junit.testsuite(
[x.to_xml() for x in self.nodereporters.values()],
[x.to_xml() for x in self.nodereporters_ordered],
name="pytest",
errors=self.stats['error'],
failures=self.stats['failure'],

View File

@ -12,7 +12,6 @@ import pytest
def runandparse(testdir, *args):
resultpath = testdir.tmpdir.join("junit.xml")
result = testdir.runpytest("--junitxml=%s" % resultpath, *args)
print(resultpath.read())
xmldoc = minidom.parse(str(resultpath))
return result, DomNode(xmldoc)
@ -61,6 +60,7 @@ class DomNode(object):
return node.value
def assert_attr(self, **kwargs):
__tracebackhide__ = True
return assert_attr(self.__node, **kwargs)
def toxml(self):