Use @Ignore in AndroidTestCase

Viewed 7777

I'm working my way through some unit testing with AndroidTestCase and was wondering, if it's possible to use the ignore-annotation, that I've read about for junit4? Just using the annotation gives an error, maybe, there's something special to look out for?

Thanx in advance, Marcus

4 Answers

@Ignore is meant to be temporarily disabled and the output shows the number of tests skipped. It also provides a parameter for the reason it's ignored.

@Suppress is meant to be excluded and does not show the number of tests skipped.

Each is useful, but it depends what you're using it for. Our team slightly prefers @Suppress because they don't want to see the number skipped in the output. You can add a comment next to the Suppress annotation to document why it's suppressed.

Related