[TIP] doctest and coverage tools still broken?
sesquile at gmail.com
Fri Nov 9 10:56:12 PST 2007
Last night I gave an talk at my local users group . The talk was
an introduction to testing and coverage. I know coverage results can
be misread, so I specifically talked about the types of coverage (even
going so far to explain cyclomatic complexity and how that might help
understand path coverage).
We then broke into pairs and worked on a simple problem doing
unittests and doctests striving to get good coverage. The attendees
claimed to really like the application part of the presentation.
Until they got to trying to use coverage with doctest.
I also got lambasted for my distro of choice (gentoo) and the fact
that I'm still running python 2.4. Now I know that the integration
between coverage and doctest is broken in 2.4 and there is a patch 
to fix it. (Hence I've still not used 2.5.... call me old fashioned)
My demo of coverage (figleaf in particular do to it's nice html
reports) works fine with doctests after patching doctest.py. However
some of the folks running 2.5 had issues with figleaf results. Do any
coverage tools work without the patch in 2.5 (with doctest)? The
source in trunk is still unpatched.... 
If not (and the solution is the patch linked to), should we file a bug
to get it in? I think it's crazy that this doesn't work out of the
box, but the fact that it still doesn't work after 3 years just seems
to illustrate how testing (and coverage) is neglected....
0 - http://panela.blog-city.com/intro_to_python_testing_talk_unittest_doctest_coverage.htm
1 - http://svn.zope.org/Zope3/trunk/src/zope/testing/doctest.py?rev=28679&r1=28703&r2=28705
2 - http://svn.python.org/view/python/trunk/Lib/doctest.py?rev=54170&view=markup
More information about the testing-in-python