# Failed: [pytest] 在 tests/test_parse.py:12 处的 'test_parse' 中参数集为空

- **ID:** `python/pytest-parametrize-empty-list`
- **领域:** python
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

pytest.mark.parametrize 收到空列表作为 argvalues，pytest 报告空参数集并默认使测试失败（由 empty_parameter_set_mark 控制）。

## 版本兼容性

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

## 解决方案

1. **** (90% 成功率)
   ```
   # pytest.ini
[pytest]
empty_parameter_set_mark = skip
   ```
2. **** (88% 成功率)
   ```
   CASES = load_cases() or [pytest.param(None, marks=pytest.mark.skip('no cases'))]

@pytest.mark.parametrize('case', CASES)
def test_parse(case): ...
   ```

## 无效尝试

- **** — Loses parameterization entirely; the test now runs once with undefined arguments and fails differently. (70% 失败率)
- **** — Hides the fact that the data source is empty, which is often the actual bug worth surfacing. (65% 失败率)
