Store doctest verbose results to a variable

Fredrik Lundh fredrik at pythonware.com
Thu May 26 13:46:51 EDT 2005


"mitchell" <mforal at gmail.com> wrote:

> Is it possible to store doctest's verbose output to a variable?
>
> For example:
>
>   import doctest, my_test_module
>   a = doctest.testmod(my_test_module)
>
> The contents of 'a' is the tuple of passed and failed results. I tried
> passing verbose mode to the testmod function, but 'a' is still a tuple.
>
> Any help is greatly appreciated.

the third example on this page

    http://effbot.org/librarybook/stringio.htm

shows one way to do that.

</F>






More information about the Python-list mailing list