How does unittest check for success/failure? Does assert throw a special kind of error class when it fails? How would you check that some code didn't throw an exception, or did throw an exception?
I'd like to write some unit tests to check my software. Writing
unittest blocks and putting assert statements in there seems easy
enough, but I noticed that if the code I run in there throws an
exception, I don't get the unit test failed message.
- unittest vs exceptions? Maxime Chevalier
- Re: unittest vs exceptions? Jonathan M Davis
- Re: unittest vs exceptions? David Nadlinger
- Re: unittest vs exceptions? Jonathan M Davis
- Re: unittest vs exceptions? Era Scarecrow
- Re: unittest vs exceptions? Tobias Pankrath
- Re: unittest vs exceptions? Jonathan M Davis
- Re: unittest vs exceptions? Maxime Chevalier
- Re: unittest vs exceptions? Jonathan M Davis
- Re: unittest vs exceptions? Jacob Carlborg