unit test for a printing method

Fredrik Lundh fredrik at pythonware.com
Tue Aug 29 04:47:52 EDT 2006


Marco Wahl wrote:

> Fredrik Lundh <fredrik at pythonware.com> writes:
>>
>> Scott David Daniels wrote:
>>
>>> For silly module myprog.py:
>>>      def A(s):
>>>          print '---'+s+'---'
>>> in test_myprog.py:
>>>      import unittest
>>>      from cStringIO import StringIO  # or  from StringIO ...
>>
>> why are you trying to reinvent doctest ?
>
> The OP asked for unit test.  This could be read that
> the OP wants to use module unittest.

    http://docs.python.org/lib/doctest-unittest-api.html

</F> 






More information about the Python-list mailing list