[Zope-dev] Get rid of doctest.py in zope.testing? (Was: Bootstrapping ZCA for Python 3.)

Lennart Regebro regebro at gmail.com
Mon Dec 7 16:08:07 EST 2009


I started a new branch for porting zope.testing to Python 3, for
several reasons, mostly because I got confused and decided starting
over with a clean copy and beginning with the new Distribute python 3
support from start would make me less foncused (it worked). The
branches aren't that different in the end, obviously:

http://svn.zope.org/zope.testing/branches/regebro-python3-reloaded/

There are 19 tests that doesn't pass yet (and that's mostly doctest
tests, so there are many actual failures), and most of those are based
in formatting differences when it comes to doctests.

For example: Exceptions in Python 3 print out the whole module path of
the exception, while in Python 2 it's only the classname: Immediate
doctest failure. This is fixable in your doctests by trapping the
exception instead, which is what I've done.

However: Many of the failing tests are tests to check that the doctest
module works. In the other modules I've ported, the doctest module has
been included because it wasn't included in Python 2.3, and could
simply be dropped with Python 2.3 support. However, in zope.testing
doctests are slightly modified and also tested. So many of the failing
tests are tests that doctest behave properly, and that the output
formatting is OK. Which, of course, it is not.

There are other differences too. The diff module seems to add empty
lines at the end sometimes, which bugger up the output, especially in
the colorful formatter tests.

Efforts to remove doctests failed on the INTERPRET_FOOTNOTES options,
which the standard Python doctests doesn't support. A quick search
turns out that ZODB, zc.catalog, zc.relation, zc.async, zc.sharing,
zc.freeze  and lovely.remotetask uses it, maybe more.

I really think it's a bad idea to have a special version of
doctest.py. I think we should get rid of it. That means either
dropping this feature, or getting it merged into Python 2.7 and 3.2.
The 2.7 beta is out now, so it's pretty urgent. I strongly suspect
it's going to be practically impossible to support zope.testing from
the same test-base otherwise.

Opinions?

-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64


More information about the Zope-Dev mailing list