I am testing Exceptions using unittest, for example:
self.assertRaises(UnrecognizedAirportError, func, arg1, arg2)
and my code raises:
raise UnrecognizedAirportError('From')
Which works well.
How to verify that an argument in an exception is what I expect?
I want to somehow claim that capturedException.argument == 'From' .
I hope this is clear enough - thanks in advance!
Tal.
python unit-testing
Tal Weiss May 19, '09 at 15:10 2009-05-19 15:10
source share