per wrote:
> 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)

I have here

   if __name__ == '__main__':
       unittest.main()

preceded by classes which derive from unittest.TestCase. Running this allows
me to write to stdout using print as usual, even though it's ugly because
it clutters the output of the testcases.

Uli

-- 
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to