[TIP] skipped testcases not reported in JUnit XML

holger krekel holger at merlinux.eu
Sat Mar 19 10:11:13 PDT 2011


Hi Pere,

thanks for reporting.  If i understand it right you ask for
a message attribute for the skip element in junitxml output.
I just implemented it and you can install a development snapshot via

    pip install -i http://pypi.testrun.org -U pytest

(py.test --version should give you 2.0.3.dev3).

Please let me know if this works for you.  I am still a bit
unsure about the JunitXML standards out there - for one, Jenkins
(formerly Hudson) does not seem to recognize skip-messages.

best,
holger

On Sat, Mar 19, 2011 at 13:34 +0100, Pere Martir wrote:
> I am not sure if this is expected or included in the "standard" of
> JUnit XML because I cannot find the latest documentation of JUnit XML
> schema.
> 
> I use imperative skip (pytest.skip) to skip some testcases but they
> are not reported in the generated JUnit XML. I want not only the
> number of skipped testcases but also their names and message
> explaining why they are skipped.
> 
> For example:
> 
> <testsuite total="1" skipped="1">
> <testcase name="testIgnorable>
> <skipped message="reason"/>
> </testcase>
> </testsuite>
> 
> (quoted from http://jira.codehaus.org/browse/SUREFIRE-303)
> 
> I find a sample JUnit XML using <skipped/> node here:
> 
> Bug 276068 - [JUnit] JUnit viewer doesn't recognise <skipped/> node
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=276068
> 
>   <testcase time="0"
> classname="org.apache.abdera.protocol.server.test.filesystem.FilesystemTest"
> name="org.apache.abdera.protocol.server.test.filesystem.FilesystemTest">
>     <skipped/>
>   </testcase>
> 
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
> 



More information about the testing-in-python mailing list