pytest_park.core.runs
source module pytest_park.core.runs
Classes
-
RunSelector — Selects benchmark runs from a run history by ID, tag, or position.
Functions
-
attach_profiler_data — Attach profiler records to matching benchmark runs.
-
select_reference_run — Select a run by explicit run_id or tag.
-
select_candidate_run — Select candidate run or default to the latest non-reference run.
-
select_latest_and_previous_runs — Select previous and latest run as a (reference, candidate) pair.
-
list_methods — List unique benchmark methods seen across runs.
source class RunSelector(runs: list[BenchmarkRun])
Selects benchmark runs from a run history by ID, tag, or position.
Methods
-
select_reference — Select a run by explicit run_id or tag.
-
select_candidate — Select candidate run or default to the latest non-reference run.
-
select_latest_and_previous — Return the second-to-last and last run as a (reference, candidate) pair.
-
list_methods — Return sorted unique benchmark method names seen across all runs.
source method RunSelector.select_reference(reference_id_or_tag: str) → BenchmarkRun
Select a run by explicit run_id or tag.
Raises
-
ValueError
source method RunSelector.select_candidate(candidate_id_or_tag: str | None, reference_run: BenchmarkRun) → BenchmarkRun
Select candidate run or default to the latest non-reference run.
Raises
-
ValueError
source method RunSelector.select_latest_and_previous() → tuple[BenchmarkRun, BenchmarkRun]
Return the second-to-last and last run as a (reference, candidate) pair.
Raises
-
ValueError
source method RunSelector.list_methods() → list[str]
Return sorted unique benchmark method names seen across all runs.
source attach_profiler_data(runs: list[BenchmarkRun], profiler_by_run: dict[str, dict[str, dict[str, object]]]) → list[BenchmarkRun]
Attach profiler records to matching benchmark runs.
source select_reference_run(runs: list[BenchmarkRun], reference_id_or_tag: str) → BenchmarkRun
Select a run by explicit run_id or tag.
source select_candidate_run(runs: list[BenchmarkRun], candidate_id_or_tag: str | None, reference_run: BenchmarkRun) → BenchmarkRun
Select candidate run or default to the latest non-reference run.
source select_latest_and_previous_runs(runs: list[BenchmarkRun]) → tuple[BenchmarkRun, BenchmarkRun]
Select previous and latest run as a (reference, candidate) pair.
source list_methods(runs: list[BenchmarkRun]) → list[str]
List unique benchmark methods seen across runs.