allowing output of code that is unittested?

per perfreem at gmail.com
Wed Jul 15 16:54:02 EDT 2009


hi all,

i am using the standard unittest module to unit test my code. my code
contains several print statements which i noticed are repressed when i
call my unit tests using:

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

is there a way to allow all the print statements in the code that is
being run by the unit test functions to be printed to stdio?  i want
to be able to see the output of the tested code, in addition to the
output of the unit testing framework.

thank you.



More information about the Python-list mailing list