2

We have a django project that using unittest-xml-reporting to provide bamboo with xml files about the test results. We would like to integrate django-nose to test for code coverage. But since django tests require a single TEST_RUNNER class, I don't see how to use in parallel both functionalities (which actually don't overlap):

for unittest-xml-reporting

TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner'

for django-nose

TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'

I've tried to get into the code, but it seems messy to write some kind of hack to join the classes together. What other options are left?

András Gyömrey
  • 1,770
  • 1
  • 15
  • 36

1 Answers1

6

Why not using just django-nose to generate xjunit XML? Just add these lines:

TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'

NOSE_ARGS = [
    '--verbosity=2',  # verbose output
    '--with-xunit',  # enable XUnit plugin
    '--xunit-file=xunittest.xml',  # the XUnit report file
]

This way you don't have to work with subclassing both Runners, which is the only way to do: creating a custom Runner and merging both what can be difficult to achieve.

danius
  • 2,664
  • 27
  • 33