[Zope-dev] zope.test.doctest made into monkey-patches (Was: Circular dependency hell.)

Jim Fulton jim at zope.com
Tue Apr 20 14:35:30 EDT 2010


On Tue, Apr 20, 2010 at 4:46 AM, Lennart Regebro <regebro at gmail.com> wrote:
> And here is another interesting experiment:
>
> svn+ssh://regebro@svn.zope.org/repos/main/zope.testing/branches/regebro-doctest-patching
>
> It replaces the custom doctest.py with monkey-patches.
> I will report these to the Python bugtracker as well, although I have
> no hope of getting them into Python 2.7. But that doesn't matter much.
> :)
>
> Benefits: We don't have to maintain a separate  doctest.py, and we get
> the bugfixes from Python. We haven't merged from Python trunk since
> 2004, and there are LOADS AND LOADS of bugfixes done on the Python
> doctest which we don't have. There are three bugfixes and two
> "features" that we have that I now monkey patch in in this branch.
>
> Drawbacks: If you import zope.testing.doctest, *all* your doctests
> will belong to us, so if you have doctests that expect the bugs, your
> out of luck. :)
> Also, I do not monkey-patch in the footer parsing support. It's too
> big, use Manuel instead if you need that.
>
>
> If noone protests, I'll merge this into my "no testrunner branch",
> make it support Python 3, and then merge that to trunk, maybe sometime
> next week.

Strong -1.

Monkey patching should be used as a last resort. Monkey
patching the standard library is likely to make us look like
jack asses.

We should switch to manuel, which already has the footnote feature.
Let zope.testing.doctest wither and die, or reimplement it as a facade
on manuel.

Jim

-- 
Jim Fulton


More information about the Zope-Dev mailing list