python config_error ai_generated true

Skipped: <Skipped instance>

ID: python/pytest-skip-no-reason

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
7.x active — — —
8.x active — — —

Root Cause

pytest.skip() was called without a reason string, or pytest.mark.skip was used without reason=, producing an unhelpful '<Skipped instance>' message.

generic

中文

调用 pytest.skip() 时没有提供原因字符串,或使用 pytest.mark.skip 时没有 reason=,导致出现无用的 '<Skipped instance>' 消息。

Workarounds

  1. 98% success
    import pytest
    
    pytest.skip("requires GPU")
    # or
    @pytest.mark.skip(reason="not supported on Windows")
    def test_x(): ...
  2. 95% success
    @pytest.mark.skipif(sys.platform == 'win32', reason='POSIX only')
    def test_x(): ...

Dead Ends

Common approaches that don't work:

  1. 80% fail

    -rs shows reasons but there is none to show.

  2. 70% fail

    xfail runs the test; may cause failures on unsupported platforms.

  3. 85% fail

    Still lacks a reason string; message remains unhelpful.