From: Gavin Sinclair Date: 2003-02-07T03:00:35+09:00 Subject: Re: Return values from assertions On Friday, February 7, 2003, 2:52:38 AM, Matt wrote: > writes: >> Matt Armstrong [mailto:matt@lickey.com] wrote: >> >>> I've often wondered how useful assert_no_exception actually >>> is, given that the framework reports uncaught exceptions anyway. >> >> The only advantage I see is if you wanted a particular exception >> that could be thrown to show up as a failure instead of an >> error. This can be particularly useful if you want to add an >> assertion message if/when that exception is thrown. > That hits the crux of my question -- the only practical difference > between a failure and an error is that the error can have a nice error > message? The conceptual difference is practical enough for me. Conceptual difference: - failure: specifically tested condition that, well, failed - error: unexpected, uncaught exception If you expect that certain code will throw an exception, you test for it and record a success or failure. If you don't expect an exception, and you get one, then either your code or your test is seriously wrong, in a different kind of way to a failed assertion. Therefore, failures and errors highlight different problems in the code, and this is a practical difference. You probably knew all that and were angling at something else... Gavin