testng-team/testng

TestNG tests produce "Static configuration methods can cause unexpected behavior" warnings

オープン

#2,554 opened on 2021/05/23

 (9 件のコメント) (0 件のリアクション) (0 人の担当者)Java (1,025 件のフォーク)github user discovery
Feature: before/aftergood first issue

Repository metrics

Stars
 (2,059 個のスター)
PR merge metrics
 (平均マージ 17h 43m) (30d で 7 merged PRs)

説明

Expected behavior

The test suite should not produce "Static configuration methods can cause unexpected behavior" warnings.

It looks like the tests should be adjusted to avoid unexpected behavior.

Actual behavior

There is a significant number of "Static configuration methods can cause unexpected behavior" warnings in the test suite.

Test case sample

TestNG > Regression2 > test.invokedmethodlistener.InvokedMethodListenerTest > issue87_method_orderning_with_disable_test_class STANDARD_OUT
    [Configuration] [WARN] Detected a static method [test.invokedmethodlistener.A.someMethod1()]. Static configuration methods can cause  unexpected behavior.
    [Configuration] [WARN] Detected a static method [test.invokedmethodlistener.A.someMethod1()]. Static configuration methods can cause  unexpected behavior.
    [Configuration] [WARN] Detected a static method [test.invokedmethodlistener.A.someMethod1()]. Static configuration methods can cause  unexpected behavior.
    [Configuration] [WARN] Detected a static method [test.invokedmethodlistener.C.someMethod3()]. Static configuration methods can cause  unexpected behavior.
    [Configuration] [WARN] Detected a static method [test.invokedmethodlistener.A.someMethod1()]. Static configuration methods can cause  unexpected behavior.
    [Configuration] [WARN] Detected a static method [test.invokedmethodlistener.A.someMethod1()]. Static configuration methods can cause  unexpected behavior.
    [Configuration] [WARN] Detected a static method [test.invokedmethodlistener.C.someMethod3()]. Static configuration methods can cause  unexpected behavior.
    [Configuration] [WARN] Detected a static method [test.invokedmethodlistener.A.someMethod1()]. Static configuration methods can cause  unexpected behavior.
    [Configuration] [WARN] Detected a static method [test.invokedmethodlistener.A.someMethod1()]. Static configuration methods can cause  unexpected behavior.
    [Configuration] [WARN] Detected a static method [test.invokedmethodlistener.A.someMethod1()]. Static configuration methods can cause  unexpected behavior.
    [Configuration] [WARN] Detected a static method [test.invokedmethodlistener.A.someMethod1()]. Static configuration methods can cause  unexpected behavior.
    [Configuration] [WARN] Detected a static method [test.invokedmethodlistener.C.someMethod3()]. Static configuration methods can cause  unexpected behavior.

コントリビューターガイド