python
config_error
ai_generated
true
Skipped: <Skipped instance>
ID: python/pytest-skip-no-reason
80%Fix Rate
90%Confidence
0Evidence
2024-03-30First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 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
-
98% success
import pytest pytest.skip("requires GPU") # or @pytest.mark.skip(reason="not supported on Windows") def test_x(): ... -
95% success
@pytest.mark.skipif(sys.platform == 'win32', reason='POSIX only') def test_x(): ...
Dead Ends
Common approaches that don't work:
-
80% fail
-rs shows reasons but there is none to show.
-
70% fail
xfail runs the test; may cause failures on unsupported platforms.
-
85% fail
Still lacks a reason string; message remains unhelpful.