python config_error ai_generated true

Skipped: no reason given

ID: python/pytest-skip-missing-reason

Also available as: JSON · Markdown · 中文
80%Fix Rate
90%Confidence
0Evidence
2024-01-05First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
7.x active
8.x active

Root Cause

A test was skipped using @pytest.mark.skip or pytest.skip() without providing a reason string. This is a warning, not an error, but can be confusing.

generic

中文

使用 @pytest.mark.skip 或 pytest.skip() 跳过了测试,但没有提供原因字符串。这是一个警告,不是错误,但可能会造成混淆。

Workarounds

  1. 98% success
    @pytest.mark.skip(reason='not implemented yet')
    def test_feature(): ...
  2. 95% success
    def test_feature():
        if not condition:
            pytest.skip('condition not met')

Dead Ends

Common approaches that don't work:

  1. 90% fail

    The test may be intentionally skipped for a valid reason.

  2. 80% fail

    xfail is for expected failures, not for skipping.