# 已跳过：<Skipped 实例>

- **ID:** `python/pytest-skip-no-reason`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

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

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 7.x | active | — | — |
| 8.x | active | — | — |

## 解决方案

1. **** (98% 成功率)
   ```
   import pytest

pytest.skip("requires GPU")
# or
@pytest.mark.skip(reason="not supported on Windows")
def test_x(): ...
   ```
2. **** (95% 成功率)
   ```
   @pytest.mark.skipif(sys.platform == 'win32', reason='POSIX only')
def test_x(): ...
   ```

## 无效尝试

- **** — -rs shows reasons but there is none to show. (80% 失败率)
- **** — xfail runs the test; may cause failures on unsupported platforms. (70% 失败率)
- **** — Still lacks a reason string; message remains unhelpful. (85% 失败率)
