-
Notifications
You must be signed in to change notification settings - Fork 3.3k
@Ignore not taking effect when used on an overriden test method #695
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
The method in the subclass is not annotated with @test |
The subclass method does need to be annotated with "@test" in order to be considered to override the superclass method for JUnit's purposes (we basically have to re-implement "overriding" for our odd reflection-based execution model.) I think this is probably a good rule to enforce, but I can understand the confusion it causes in this case. I might consider adding a validation check that would flag an error if a superclass method with @test matches the name of a subclass method without @test. Would that have solved your problem? |
Yes, that would've worked as well. |
With @ignore but not @test the method is still executed by JUnit: junit-team/junit4#695 PiperOrigin-RevId: 348009981
When I have a test in super class which I then override in subclass and add the Ignore annotation to this overriden test, the test is run anyway. (Not ignored.)
Reproducer for the issue can be found here:
https://github.com/triceo/junit/commit/14e5d37f09d7c822d93a172481796524017735ee
The text was updated successfully, but these errors were encountered: