skillfed

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.

pytest-harvest v1.10.5 730.5K downloads/30d#5,212 on PyPI77
Permissive license BSD 3-Clause AGING released

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-harvest

uv

uv add pytest-harvest

poetry

poetry add pytest-harvest

Installing 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

Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Testing

Tags

pytest test data collectioncapture pytest resultspytest session data storagetest benchmarking pytestpytest fixture data retrievalpytest test metrics collectionpytest result aggregation
pytest-plugintest-metricsbenchmarking

More Python Modules packages