On Tue, Apr 06, 2010 at 12:15:41PM -0400, Tres Seaver wrote: > Some discussion of the general problem of doctests breaking due to exception > formatting led to a suggestion from Jim Fulton that we implement a testing > API similar the ``unittest.TestCase.assertRaises``, but with the additional > feature that it returns the exception value, to permit further assertions > about the state of that object.
unittest.TestCase.assertRaises gives you access to the exception value afterwards, starting with Python 2.7. It's been backported to older versions of Python and placed on PyPI as unittest2: http://pypi.python.org/pypi/unittest2 Marius Gedminas -- http://pov.lt/ -- Zope 3 consulting and development
Description: Digital signature
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )