Skip to content

Commit 68ba23c

Browse files
chore: pin pytest-benchmark 5.2.3 and clarify json.dumps in bench fixtures
Pin pytest-benchmark to 5.2.3 after verifying compatibility with pytest 9.0 and the benchmark suite. Annotate benchmark JSONL serialization to document that json.dumps is intentional for file I/O, not Flask jsonify.
1 parent bfdd7c3 commit 68ba23c

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ pytest-cov>=5.0
66
ruff>=0.9.0
77
pip-audit>=2.7.0
88
hypothesis>=6.100.0
9-
pytest-benchmark>=4.0.0
9+
pytest-benchmark==5.2.3

tests/benchmarks/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ def write_jsonl(path: Path, line_count: int) -> Path:
2323
msg = entry.setdefault("message", {})
2424
if isinstance(msg, dict) and "content" in msg:
2525
msg["content"] = [{"type": "text", "text": f"benchmark token {i} searchable"}]
26-
f.write(json.dumps(entry, separators=(",", ":")) + "\n")
26+
# json.dumps for file I/O — jsonify is Flask's HTTP helper, not file serialization.
27+
serialized = (
28+
json.dumps(entry, separators=(",", ":")) + "\n" # linters-ignore: prefer-jsonify
29+
)
30+
f.write(serialized)
2731
return path
2832

2933

0 commit comments

Comments
 (0)