Message276334
So, you could do:
exc = self.assertRaises(ValueError, somefunc, someargs)
And then, explore "exc" as will.
Yes, you can get the exception if you use assertRaises as a context manager, but that leads to more cumbersome code:
with self.assertRaises(ValueError) as cm:
somefunc(someargs)
exc = cm.exception |
|
Date |
User |
Action |
Args |
2016-09-13 20:12:11 | facundobatista | set | recipients:
+ facundobatista |
2016-09-13 20:12:11 | facundobatista | set | messageid: <1473797531.08.0.417014131559.issue28135@psf.upfronthosting.co.za> |
2016-09-13 20:12:11 | facundobatista | link | issue28135 messages |
2016-09-13 20:12:11 | facundobatista | create | |
|