A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-December/094470.html below:

[Python-Dev] Unittest/doctest formatting differences in 2.7a1?

[Python-Dev] Unittest/doctest formatting differences in 2.7a1? [Python-Dev] Unittest/doctest formatting differences in 2.7a1?R. David Murray rdmurray at bitdance.com
Wed Dec 9 18:52:22 CET 2009
On Wed, 09 Dec 2009 18:23:11 +0100, Lennart Regebro wrote:
> If the exception format has changed, I consider it a bug. Possibly a
> bug in doctest, as the only way to test for exceptions in that case is
> like this:
> 
>     >>> try:
>     ...     throw_an_exception()
>     ...     print "Did not throw the exception"
>     ... except DesiredException:
>     ...     print "passed"
>     passed
> 
> And that frankly is rather ugly. That's how I have done with doctests
> when porting to Python 3 so far. I don't think it's a good idea to
> require it for Python 2.7 as well.

If it's a bug it would have to be in doctest, since the format of
traceback messages is explicitly *not* part of the Python API.

In what way is the doctest ellipsis support not sufficient for this
case?

--David (RDM)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4