Various behaviors of doctest

Gnarlodious gnarlodious at gmail.com
Sun Feb 27 11:55:10 EST 2011


Using the doctest module, I get three different outputs:

1) From the Terminal shell, I see a full report:
python ~/Sites/Sectrum/Filter.py -v

2) From the Terminal interactive session, I see an abbreviated report
of only the failures:
from doctest import testmod; testmod(Filter)

3) From a browser CGI, I see a named tuple:
from doctest import testmod; doctest.testmod()

This returns output like:

TestResults(failed=1, attempted=5)

The browser is invoking the exact same code as the shell doctest, so
why should it return a named tuple? And how do I get it to return the
full text so I can read it in the browser?

-- Gnarlie



More information about the Python-list mailing list