{
  "id": "python/pytest-parametrize-empty-argvalues",
  "signature": "SKIPPED [1] tests/test_math.py:12: got empty parameter set ['a', 'b'], function test_add",
  "signature_zh": "SKIPPED [1] tests/test_math.py:12: 参数集 ['a', 'b'] 为空，函数 test_add",
  "regex": "SKIPPED\\ \\[1\\]\\ tests/test_math\\.py:12:\\ got\\ empty\\ parameter\\ set\\ \\['a',\\ 'b'\\],\\ function\\ test_add",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "`@pytest.mark.parametrize` received an empty list of values, so the test is collected but skipped. Often the data source (fixture, file, computed list) returned nothing.",
  "root_cause_type": "generic",
  "root_cause_zh": "`@pytest.mark.parametrize` 收到空的取值列表，因此测试被收集但跳过。通常是数据源（fixture、文件、计算列表）返回空。",
  "versions": [
    {
      "version": "7.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Already skipped; adding skip does not surface the underlying empty-data problem, which is usually a bug.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Hides the real issue (data source empty) and reduces coverage silently.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Fail fast when the data source is unexpectedly empty:\nCASES = load_cases()\nif not CASES:\n    pytest.fail('no cases loaded from fixtures/cases.json')\n@pytest.mark.parametrize('a,b', CASES)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Or use `pytest_generate_tests` to raise a clear error:\ndef pytest_generate_tests(metafunc):\n    if 'a' in metafunc.fixturenames:\n        cases = load_cases()\n        if not cases:\n            pytest.fail('empty case set')\n        metafunc.parametrize('a,b', cases)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-10-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}