testing: Document interaction of Skip and Error #16502
Comments
This feels like an abuse of For tests like this, I'd rather see a higher level construct. Maybe a function |
/cc @robpike also for testing+wording thoughts. |
@broady, I don't think the answer to this bug is more API. |
I agree with @bradfitz. No more API is called for. Since you're asking my opinion, here it is: A failed test should not be skippable after the failure. The test has run and failed. As @broady says, this feels like an abuse. Documentation is called for, maybe. It takes a twisted mind to think that you can skip after a test has run. |
As it is assigned to me, I agree it feels like an abuse. Furthermore, it would be non-trivial, though not hard, to implement unskipping tests, but people may then get further expectations of parent tests calling Skip undoing failures of child tests and what have you. |
It feels weird, certainly, but it is a very useful construct to be able to say "this test should fail". I don't see another way to do it given the current testing API? |
I don't think it's useful enough to introduce such tricky semantics and vote firmly against this being made official. |
CL https://golang.org/cl/31324 mentions this issue. |
Expected:
Actual:
I'm guessing this is not actually a bug, but I don't see anything in https://golang.org/pkg/testing/ describing how Skip and Error are supposed to interact. It doesn't seem unreasonable to think that a test could be Skipped after it has already Failed, but that turns out not to be the case as implemented.
Could someone with more in-depth knowledge of the testing package please confirm whether this behavior is intended (and, if so, update the documentation)?
The text was updated successfully, but these errors were encountered: