[issue22710] doctest exceptions include nondeterministic namespace

R. David Murray report at bugs.python.org
Thu Oct 23 19:04:58 CEST 2014


R. David Murray added the comment:

Not to 2.7, since that would be a new feature.

In Python we do not consider the content of an error message (as opposed to the exception class itself) to be part of the API, so it is not surprising that doctest does not really support checking it across versions.  That said, I agree that it would be nice to have.  If you want to propose a feature patch you can reopen the issue and update the title.

A workaround would be to capture the exception and display its str.  This would have the advantage of not cluttering your doctests with the Traceback lines, at the cost of having a try/except in your code sample.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22710>
_______________________________________


More information about the Python-bugs-list mailing list