[New-bugs-announce] [issue6275] let unittest.assertRaises() return the exception object caught

Kristján Valur Jónsson report at bugs.python.org
Fri Jun 12 23:43:14 CEST 2009


New submission from Kristján Valur Jónsson <kristjan at ccpgames.com>:

It can be useful, after a unittest.assertRaises() or assertRaisesRegexp() 
to be able to take a closer look at the exception that was raised.
To this end, I propose returning the caught exception from these methods.

Additionally, the context manager involved with keep the caught exception 
in its exc_value member after it has been successfully thrown (and 
matched)

----------
components: Library (Lib)
files: unittest.patch
keywords: easy, needs review, patch, patch
messages: 89304
nosy: krisvale
severity: normal
status: open
title: let unittest.assertRaises() return the exception object caught
type: feature request
versions: Python 2.7
Added file: http://bugs.python.org/file14280/unittest.patch

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


More information about the New-bugs-announce mailing list