unit test for a printing method

Fredrik Lundh fredrik at pythonware.com
Mon Aug 28 11:59:33 EDT 2006


noro wrote:

> What is the proper way to test (using unit test) a method that print
> information?
> for example:
> 
> def A(s):
>          print '---'+s+'---'
> 
> and i want to check that A("bla") really print out "---bla---"

http://docs.python.org/lib/module-doctest.html

</F>




More information about the Python-list mailing list