pytest-harvest
Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes.
What it is and what it does
pytest-harvest is a pytest plugin that intercepts and stores arbitrary data generated during test execution, then makes that data available after the test session ends. It's designed for scenarios where you need to collect metrics, benchmarks, or other artifacts from individual tests and analyze them as a group—rather than just pass/fail results.
The package works by providing hooks into pytest's execution lifecycle. You store data during test runs (typically via fixtures or direct API calls), and pytest-harvest holds that data in memory, making it queryable once all tests complete. This is particularly useful for applicative benchmarking, where you want to gather performance numbers from many test cases and analyze them together, or for collecting structured test artifacts that need post-processing.
Use it for:
- Collect performance metrics from multiple test runs and generate a summary report at the end of the session.
- Store custom data (e.g., API response times, memory usage) from each test for later analysis or export.
- Aggregate test results into a dataframe for statistical analysis or visualization after the test suite finishes.
- Benchmark different code paths across a test suite and compare results in a single report.
- Archive test artifacts and metadata for post-mortem analysis without writing individual files per test.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pytest-harvest captures and stores data generated during test execution, making it available for retrieval after the test session completes—useful for benchmarking, result aggregation, and post-test analysis.
Yes, if you need to collect and aggregate data across multiple tests for benchmarking or post-test analysis. The package is production-stable, has low install friction, and carries no security vulnerabilities. The aging status (881 days since release) is a minor concern but not a blocker if pytest compatibility remains adequate; verify that it works with your pytest version before committing to it.
Install
pytest-harvest on PyPI
pip
pip install pytest-harvestuv
uv add pytest-harvestpoetry
poetry add pytest-harvestInstalling pytest-harvest
Before you install
Low install friction with six runtime dependencies; the package is aging (881 days since last release) but maintains production-stable status and the repository remains active with a recent commit.
License in practice
BSD 3-Clause is permissive and poses no restrictions on commercial or private use; you may use, modify, and distribute the package freely provided you include the license notice.
Quickstart
pip install pytest-harvest
import pytest_harvest
# In a test, store data via pytest_harvest's fixture or API
# Retrieve aggregated results after session completes
Verify before relying
- Whether the package works with pytest versions currently in active use
- Whether the aging status (881 days since release) affects compatibility with modern test frameworks
- How to access stored data programmatically after session completion
Package facts
| License | BSD 3-Clause (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — packaging, decopatch, makefun, six, pathlib2, funcsigs |
| Maintenance | aging — 881 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 730,549/month — #5,212 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_harvest-1.10.5-py2.py3-none-any.whl
Keywords: pytest, test, result, store, fixture, collect, benchmark, artifact, session, data, dataframe
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pytest-casespytest-cases lets you separate test case data…
permissive · top 5,000 on PyPI
pytest-benchmarkA pytest fixture that benchmarks Python…
permissive · top 5,000 on PyPI
pytest-printAdds fixtures to pytest that print messages…
permissive · top 15,000 on PyPI
pytest-catchlogA pytest plugin that automatically captures log…
permissive · top 15,000 on PyPI
outcomeCaptures the outcome of Python function…
permissive · top 1,000 on PyPI
pytest-structlogProvides a pytest fixture for capturing and…
permissive · top 15,000 on PyPI
pytest-reraiseCaptures exceptions raised in threads during…
permissive · top 15,000 on PyPI
pytest-metadataA pytest plugin that captures and exposes test…
copyleft · top 1,000 on PyPI
buildkite-test-collectorCollects test execution data from pytest and…
permissive · top 5,000 on PyPI
genbadgeGenerates SVG badges for CI/CD tools and test…
permissive · top 15,000 on PyPI