jeudi 4 décembre 2014

Python getting individual test times


Vote count:

0




I have a few unit tests written using the native unittest module for Python 3. This is the way in which I am invoking them:



if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(TestUser)
unittest.TextTestRunner(verbosity=2).run(suite)


At the end of the test for the class it provides an overall time for how long it took to move through the whole process. I have two issues with this:



  • My setUp() function takes a few seconds to process and I don't want to count this time

  • I would prefer to get a synapsis of the time each individual test took (not all the tests in the class)


Is this possible with this module?



asked 2 mins ago







Python getting individual test times

Aucun commentaire:

Enregistrer un commentaire