I am having problems with nosestests writing to the unittext xml file twice.
I have this python script
import unittest
class aa(unittest.TestCase):
def test_aa(self):
self.assertTrue(True)
testlist = []
suite = unittest.TestLoader().loadTestsFromTestCase(aa)
testlist.append(suite)
allSuites = unittest.TestSuite(testlist)
unittest.TextTestRunner(verbosity=3).run(allSuites)
print 'done'
The problem is if I run it like this
nosetests --with-xunit -s --verbosity=2 test.py
I get this output
test_aa (test.aa) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK
done
.
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK
The problem is this writes to the nosetests.xml file twice. Is there any way to only make this run the test once?
The reason I need this is I have a unit test that basically runs fine the first time, then fails the second time and the xml file is getting overwritten with 0 tests run.
Cheers,
Paul