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) _______________________________________________ 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