testng-team/testng

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

已关闭

#3,138 创建于 2024年6月14日

 (0 条评论) (0 个反应) (0 位负责人)Java (1,025 个派生)github user discovery
Feature: ignoregood first issueinheritancesite/doc

仓库指标

星标
 (2,059 个星标)
PR 合并指标
 (平均合并 17小时 43分钟) (30 天内合并 7 个 PR)

描述

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.

贡献者指南