From e49714f6f99e867dd1df771a556fceffd6227301 Mon Sep 17 00:00:00 2001 From: Oliver Bristow Date: Sat, 9 May 2026 09:55:51 +0100 Subject: [PATCH] Remove benchmark helper and use pytest-benchmark fixture directly --- README.md | 2 +- examples/test_benchmark.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fef8c2e..cc63bdb 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ assert constant_number() == 2 # alternative implementations still act like themselves assert unused_alternative_constant_number() == 3 -# TODO: mash in measure + benchmark + equality tests from examples +See `examples/test_measure.py`, `examples/test_equivalence.py`, and `examples/test_benchmark.py` for measure, equivalence, and benchmark pytest patterns (the benchmark example uses the `pytest-benchmark` fixture). ``` The library tries to avoid unpleasant surprises that may come from import orders or maintenance issues: diff --git a/examples/test_benchmark.py b/examples/test_benchmark.py index 0987467..8aefbc9 100644 --- a/examples/test_benchmark.py +++ b/examples/test_benchmark.py @@ -15,5 +15,5 @@ def alternative_implementation1(): @reference_implementation.pytest_parametrize(only_default=False) def test_f(benchmark, implementation): - """Compare the output of the reference (with caching) and each alternative implementation.""" + """Benchmark all implementations using the pytest-benchmark `benchmark` fixture.""" assert benchmark(implementation) == 1