[Python-Dev] assertRaises

Antoine Pitrou solipsis at pitrou.net
Thu Jul 17 11:12:59 CEST 2008

Fred Drake <fdrake <at> acm.org> writes:
> Sounds like adding a new method, catchException(...), that returns the  
> exception it catches, would be a reasonable compromise.  I can't think  
> of any reason that the method that catches-and-returns needs to be the  
> existing API, which does something different.

So you'd have a method that just catches (assertRaises), and another one that 
catches-and-returns (catchException)?
It doesn't seem very practical to have two different methods based on such a 
small and trivial difference.
Let's just make assertRaises return the exception instance, it seems like it 
feels the need correctly.

More information about the Python-Dev mailing list