mercredi 4 février 2015

Storing the the results of unit test in python in some SQL Database

I am learning the different possibilities to write and run (unit) tests in Python. I would like to store the output of the tests in a SQL database -preferably sqlite.


I found a way to run the tests using the nose framework from inside the code like this:



import nose
import os

os.chdir('./projects/project A')

result = nose.run()

print 'The result:', result


And I get the following output:



The result: True
....
----------------------------------------------------------------------
Ran 4 tests in 0.013s

OK


I am forced to parse the stderr/stdout or is there any better way to get the test results and messages for further processing ?


Aucun commentaire:

Enregistrer un commentaire