Comment 2 for bug 1178412

Revision history for this message
Christian Ang (cang) wrote :

Now that I think about it the clean up was a bad example of a use case for a callback on an assert considering you could clean up on an tear down or with the action attribute. However, the case I ran into recently was I needed to log when an assert failed using our frameworks logger.

Now without a callback on an assert the only way I could perform work when a specific assert failed was to use a try/catch where I was able to try the assert, do my logging in the catch if it failed, and throw it back afterwards.

I think it would be much nicer to allow the user to specify a callback instead of performing a try/catch so it can still be a nice one liner and keep the test case clean.