A Python unittest TestResult that outputs JUnit compatible XML.
PyJUnitXML is Copyright (c) 2009 Robert Collins, and distributed under the
GNU Library General Public Licence version 3 (LGPL-3). Broadly, this means you
have the right to use this library in any application you want, regardless of
the licence of your application, but that if you modify this library the
modifications you make need to be released under a compatible terms if you
convey the application to other users. For exact details see the COPYING and
GPL-3 files included in the source.
Usage
-----
To use PyJUnitXML you need to specify it as your ``TestResult`` when running
your tests using pyunit. One way of doing this is to invoke the ``test`` method
directly on your test suite::
>>> import junitxml
>>> result = junitxml.
>>> result.
>>> suite.run(result)
>>> result.
The ``startTestRun`` and ``stopTestRun`` methods are new in python 2.7 and 3.1.
If you are using older versions of python, and do not invoke the test result
directly, you may find that no output occurs at all. This is likely because the
``stopTestRun`` method is not being invoked, and you will need to arrange for it
to be invoked.
Troubleshooting
---------------
My test runs, but nothing is output? Check that ``result.
called. Due to the XML file format requiring a header containing the test
counts, nothing is output until the test run has completed, and that is
signalled by the ``stopTestRun`` method being called.
Project information
- Licence:
- GNU LGPL v3
View full history Series and milestones
trunk series is the current focus of development.
All code Code
- Version control system:
- Bazaar
- Programming languages:
- python
All questions Latest questions
All packages Packages in Distributions
-
pyjunitxml source package in Xenial
Version 0.6-1.1ubuntu1 uploaded -
pyjunitxml source package in Trusty
Version 0.6-1.1build1 uploaded -
pyjunitxml source package in Sid
Version 0.7-2 uploaded -
pyjunitxml source package in Precise
Version 0.6-1 uploaded -
pyjunitxml source package in Mantic
Version 0.7-2 uploaded
All bugs Latest bugs reported
-
Bug #1491635: Test failures (and FTBFS) in Wily with Python 3.5
Reported -
Bug #1320053: subunit2junitxml fails to output subunit stream
Reported -
Bug #1243928: junitxml format isn't including total skipped testcases
Reported -
Bug #892293: Jenkins is not reporting the skipped tests
Reported -
Bug #625589: babune junitxml not well formed on Python 2.7
Reported