[issue4444] unittest - use contexts to assert exceptions

Steve Purcell report at bugs.python.org
Thu Nov 27 15:07:42 CET 2008

Steve Purcell <purcell at users.sourceforge.net> added the comment:

I like this change, since assertRaises can be a bit messy when passing it 
a local function.
I'd suggest modifying the patch such that the AssertRaisesContext class is 
also used when callableObj is provided, which would eliminate the 
duplication of the code that checks for exceptions.

nosy: +purcell

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list