Python exception exceptions

So, I am trying to match the exception with the doctrine.

>>> api = Api("foo", "bar") # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... AuthError 

The problem is that this works with py2.7, but not python 3. The exception tracking format has been changed, so now it includes the full name of the module. That is, in python 3, package.module.AuthError instead.

Is there a way to match both? It seems that IGNORE_EXCEPTION_DETAIL is not valid here.

+7
python exception doctest
source share
1 answer

This was inadvertently broken by a patch for a related issue: IGNORE_EXCEPTION_DETAIL should ignore the module name

and the unexpected behavior you see is an open issue here: doctest.IGNORE_EXCEPTION_DETAIL does not match when there are no details

So this is a mistake, in my opinion. This is pretty good assurance that it will be fixed since I wrote doctest to begin with ;-) In the meantime, you can try the patch attached to bug report 2.

Followup Last night I checked the fix for this that will appear in the next releases of Pythons 2.7, 3.3, and 3.4. Thanks for the push :-)

+8
source share

All Articles