Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class-level @Ignore does not disable execution of tests in nested classes #3138

Open
3 of 7 tasks
Philzen opened this issue Jun 14, 2024 · 0 comments
Open
3 of 7 tasks

Comments

@Philzen
Copy link
Contributor

Philzen commented Jun 14, 2024

TestNG Version

v7.10.2

@Ignore
public class TestngClassLevelAnnotationTest {

    @Test void foobar() {
        System.out.println("Foobar!");
    }

    public static class TopicTests {

        @Test void baz() {
            System.out.println("Baz!");
        }
    }
}

Expected behavior

From the JavaDoc of @Ignore

Notice that @ignore on a class will disable all test methods of the class. Ignoring a class will ignore tests from child classes too.

Actual behavior

Baz!

===============================================
Default Suite
Total tests run: 1, Passes: 1, Failures: 0, Skips: 0
===============================================

Suggested solution

Update the (Java)Doc, as users probably rely on this behavior (and it is the much simpler fix).

Is the issue reproducible on runner?

  • Shell
  • Maven
  • Gradle
  • Ant
  • Eclipse
  • IntelliJ
  • NetBeans

Contribution guidelines

Incase you plan to raise a pull request to fix this issue, please make sure you refer our Contributing section for detailed set of steps.

@Philzen Philzen changed the title @Ignore Class-level @Ignore does not disable execution of tests in nested classes Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant