diff --git a/CHANGELOG b/CHANGELOG index 0db181d24..25f874b0b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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, diff --git a/_pytest/junitxml.py b/_pytest/junitxml.py index 503d8606b..88c16f1f2 100644 --- a/_pytest/junitxml.py +++ b/_pytest/junitxml.py @@ -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('') logfile.write(Junit.testsuite( self.tests, - name="", + name="pytest", errors=self.errors, failures=self.failed, skips=self.skipped, diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 139ba50e5..24beff5a8 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -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("""