JUnit @Ignore usefulness?

后端 未结 6 1522
没有蜡笔的小新
没有蜡笔的小新 2021-02-05 11:47

In JUnit you can use @Ignore before methods to tell the test runner to automatically skip those tests. From what I can gather, this is really only a convenient way

6条回答
  •  时光取名叫无心
    2021-02-05 12:40

    IMHO, @Ignore's usefullness would be to know in the reports that there are x skipped tests, which you don't get if the test isn't annotated as a test or is commented. Failing the tests isn't a good option as we know that the tests we want to ignore aren't relevant at some point, but will have to be reenabled later. So we want to see if all the other tests will succeed/fail, knowing that we will skip the irrelevant ones (the fact that we've skipped them will be visible in reports).

提交回复
热议问题