On Wed, Dec 9, 2009 at 18:45, Ian Bicking <i...@colorstudy.com> wrote:
> It's about time doctest got another run of development anyway.  I can
> imagine a couple features that might help:
> * Already in there, but sometimes hard to enable, is ellipsis.  Can you
> already do this?
>
>     >>> throw_an_exception()
>     Traceback (most recent call last):
>         ...
>     DesiredException: ...

I think so, but what you need is:

>     >>> throw_an_exception()
>     Traceback (most recent call last):
>         ...
>    ...DesiredException: ...

Because one of the changes in Python 3 is that you now get the full
class path to the exception.

> * Maybe slightly more general, would be the ability to extend OutputCheckers
> more easily than currently.  Maybe for instance "# py_version(less=2.7)"
> would enable the "py_version" output checker, which would always succeed if
> the version was greater than or equal to 2.7 (effectively ignoring the
> output).  Or, maybe checkers could be extended so they could actually
> suppress the execution of code (avoiding throw_an_exception() from being
> called twice).

zope.testing has an output checker to which you can add transformers,
that's run on both the expected and actual output. Something like that
might work. We could then have a transformer that handles differences
in exception formats by default.

-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to