JUnit-style XML output for Django tests
django-jux/JUXD is an attempt to get JUnit-style XML output from the Django test runner. It does a few notable things:
This job can be done using nose’s xunit plugin, but with the unittest improvements in Python 2.7, my only reason for using nose was for the xunit plugin itself. nose is a bit of a heavy hitter, but it’s a (really good) generic test runner, not django specific. I wanted something a little more targeted, and this is the result.
The main motivator behind this was getting test output into Jenkins CI, which works perfectly.
Install Django >=1.3 and set up a project. Then, in your django project settings:
# Tell Django to use the JUXD Test Suite Runner TEST_RUNNER = 'juxd.JUXDTestSuiteRunner' # Where to write the output JUXD_FILENAME = '/path/to/junit.xml'
This module pulls inspiration from a lot of sources, and credit is due to all of them: