{
  "id": "python/pytest-snapshot-mismatch",
  "signature": "snapshot_assertion_failed: Snapshot 'test_render' does not match.\nReceived value does not match the stored snapshot.\nUse --snapshot-update to regenerate.",
  "signature_zh": "snapshot_assertion_failed: 快照 'test_render' 不匹配。\n接收值与存储的快照不匹配。\n使用 --snapshot-update 重新生成。",
  "regex": "snapshot_assertion_failed:\\ Snapshot\\ 'test_render'\\ does\\ not\\ match\\.\\\nReceived\\ value\\ does\\ not\\ match\\ the\\ stored\\ snapshot\\.\\\nUse\\ \\-\\-snapshot\\-update\\ to\\ regenerate\\.",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "snapshot testing (pytest-snapshot, syrupy, snapshottest) compares output to a stored file; any change in output (intentional or not) causes a mismatch.",
  "root_cause_type": "generic",
  "root_cause_zh": "快照测试（pytest-snapshot、syrupy、snapshottest）将输出与存储文件比较；输出任何变化（有意或无意）都会导致不匹配。",
  "versions": [
    {
      "version": "0.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Accepts whatever the code currently produces, including regressions; snapshots become rubber stamps.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Next run recreates it from current (possibly buggy) output, losing the historical baseline.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Hides the diff and prevents catching real regressions; xfail state tends to linger.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "pytest tests/test_render.py -k test_render --snapshot-details\n# review the diff, then\npytest --snapshot-update tests/test_render.py",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "def sanitize(output):\n    output.pop('timestamp', None)\n    output['id'] = '<id>'\n    return output\n\ndef test_render(snapshot):\n    snapshot.assert_match(sanitize(render()), 'render.json')",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-10-25",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}