I used the assertRaises() to validation there will be an exception thrown and there is no problem of this.
My question is, is there any way to get the exception message from assertRaises()? I would like to assert for different types of exceptiosn as well by parsing the exception message..
I use following decorator inspired by one in nose:
So I can do something like:
The
@decoratoris from decorator package. You can write decorator by hands if you don’t want to introduce a dependency for some reason.