{
  "id": "python/pytest-benchmark-no-results",
  "signature": "pytest_benchmark.fixture.BenchmarkFixture.NotEnoughTests: Unable to produce a benchmark: no rounds executed (target time 0.0s, min_rounds 0)",
  "signature_zh": "pytest_benchmark.fixture.BenchmarkFixture.NotEnoughTests：无法生成基准测试：未执行任何轮次（目标时间 0.0s，min_rounds 0）",
  "regex": "pytest_benchmark\\.fixture\\.BenchmarkFixture\\.NotEnoughTests:\\ Unable\\ to\\ produce\\ a\\ benchmark:\\ no\\ rounds\\ executed\\ \\(target\\ time\\ 0\\.0s,\\ min_rounds\\ 0\\)",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The benchmarked function raised an exception inside the benchmark callable, or calibration settings (--benchmark-min-rounds=0 --benchmark-max-time=0) collapsed the run to zero iterations. Exception inside the function is silently swallowed by pytest-benchmark and reported as NotEnoughTests.",
  "root_cause_type": "generic",
  "root_cause_zh": "被基准测试的函数在 benchmark 可调用对象内部引发了异常，或者校准设置（--benchmark-min-rounds=0 --benchmark-max-time=0）将运行压缩为 0 次迭代。函数内部的异常会被 pytest-benchmark 静默吞掉并报告为 NotEnoughTests。",
  "versions": [
    {
      "version": "4.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If the function raises on every call, more rounds still fail; the exception is the root cause, not the round count.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "pytest-benchmark invokes the callable internally; wrapping the fixture call does not catch exceptions raised inside the benchmark loop.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "def test_parse_works():\n    assert parse('1,2,3') == [1, 2, 3]\n\ndef test_parse_bench(benchmark):\n    result = benchmark(parse, '1,2,3')\n    assert result == [1, 2, 3]",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "pytest --benchmark-verbose tests/test_bench.py -s",
      "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": []
}