As for the current behavior, setUp/tearDown happens at the method level, and so there's a clear "line of reporting" between a failure in setup/teardown and a test method. In other words, if a test method fails due to a failure in setUp, it's simple to assign that failure at the test method level b/c it all happens at the same try/catch block.
However, with before/after Tests(), that happens *before* methods are iterated and consequently when a failure occurs, the error could be attached to the testcase itself but it'd like -- currently, at any rate -- not surface because in all interfaces (web, ANT) the test method is the most specific item... testcase's have no data themselves except for a name and a collection of methods.
Thinking about how to address the behavior you describe -- which I agree is not ideal -- what if we'd wrap beforeTests() in try/catch and, if a failure occurs:
1) save that exception
2) iterate over all methods
3) fail all of those methods immediately using the error from beforeTests()
This way, we can both clearly identify the cause of the error (which would be duplicated amongst all methods in the testcase) and correctly surface the impact of that beforeTests() error.... if there are 10 methods in the testcase, then you'd see 10 test errors and not a single "dummy" error.
Thoughts?
Thanks for bringing this up, Adam.
Marc