fix issue355: junitxml generates name="pytest" tag.

This commit is contained in:
holger krekel 2013-09-26 08:45:50 +02:00
parent b5a83a6af1
commit 2bdd034242
3 changed files with 7 additions and 5 deletions

View File

@ -23,7 +23,9 @@ Changes between 2.3.5 and 2.4.DEV
monkeypatch.replace("requests.get", myfunc
will replace the "get" function of the "requests" module with ``myfunc``.
- fix issue355: junitxml puts name="pytest" attribute to testsuite tag.
- fix issue322: tearDownClass is not run if setUpClass failed. Thanks
Mathieu Agopian for the initial fix. Also make all of pytest/nose finalizer
mimick the same generic behaviour: if a setupX exists and fails,

View File

@ -62,8 +62,8 @@ def bin_xml_escape(arg):
def pytest_addoption(parser):
group = parser.getgroup("terminal reporting")
group.addoption('--junitxml', '--junit-xml', action="store",
dest="xmlpath", metavar="path", default=None,
group.addoption('--junitxml', '--junit-xml', action="store",
dest="xmlpath", metavar="path", default=None,
help="create junit-xml style report file at given path.")
group.addoption('--junitprefix', '--junit-prefix', action="store",
metavar="str", default=None,
@ -217,7 +217,7 @@ class LogXML(object):
logfile.write('<?xml version="1.0" encoding="utf-8"?>')
logfile.write(Junit.testsuite(
self.tests,
name="",
name="pytest",
errors=self.errors,
failures=self.failed,
skips=self.skipped,

View File

@ -37,7 +37,7 @@ class TestPython:
result, dom = runandparse(testdir)
assert result.ret
node = dom.getElementsByTagName("testsuite")[0]
assert_attr(node, errors=0, failures=1, skips=3, tests=2)
assert_attr(node, name="pytest", errors=0, failures=1, skips=3, tests=2)
def test_timing_function(self, testdir):
testdir.makepyfile("""