[Zope-dev] zope.testing 3.8.6 emits deprecation warnings from itself?

Marius Gedminas marius at gedmin.as
Wed Dec 30 11:29:47 EST 2009


On Wed, Dec 30, 2009 at 03:08:26PM +0100, Lennart Regebro wrote:
> On Wed, Dec 30, 2009 at 13:45, Marius Gedminas <marius at gedmin.as> wrote:
> > I don't remember, exactly, I was just grepping the diffs for
> > DocTestFailureException.  It's probably the bit that lets bin/test -c
> > colorize things like diffs, and tracebacks in doctest failures.
> > If that's the case, I'd truly hate to lose this feature, it helps me
> > immensely.
> 
> OK, so that colorizing support could probably also be moved into stdlib.
> If someone (ie you, you seem to be on top of the problems) get diffs
> into the Python tracker then maybe we could get it into Python 2.7 and
> 3.2, which would be cool.

The only thing needed from doctest.py, AFAIU, is a custom exception
class inheriting from AssertionError, so the test runner (which does the
colorization) can distinguish doctest errors from regular assertion
failures.

It should be simple to monkey-patch this too, by setting
DocTestCase.failureException, so we can support Python 2.5 through 3.1

> > How mechanical can such a transformation be?  Is it sufficient to
> > replace
> >
> >  zope.testing.doctest.DocFileSuite('foo.txt', **kw)
> >
> > with
> >
> >  manuel.testing.TestSuite(manuel.doctest.Manuel(), 'foo.txt', **kw)
> 
> No idea, the Manuel experts need to answer that. :)

I was afraid you'd say that...

Marius Gedminas
-- 
http://pov.lt/ -- Zope 3 consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20091230/4ae1d76c/attachment-0001.bin 


More information about the Zope-Dev mailing list