pytest-csv
CSV output for pytest.
What it is and what it does
pytest-csv is a pytest plugin that captures test execution results and writes them to a CSV file instead of (or in addition to) the standard pytest output. It provides fine-grained control over which test metadata columns to include—such as test name, status, duration, markers, parameters, and system information—and allows customization of CSV formatting options like delimiter and quote character.
The plugin is useful for test result aggregation, reporting, and analysis workflows where you need structured data rather than human-readable console output. It integrates directly into pytest's execution model via command-line flags and supports dynamic column generation through conftest.py hooks, allowing you to record custom properties from individual tests.
Use it for:
- Export test results to CSV for import into spreadsheets or data analysis tools for trend analysis and reporting.
- Capture test execution metrics (duration, status, parameters) in a structured format for CI/CD pipeline integration.
- Generate test reports that include system and environment information (host, Python version, OS) alongside test outcomes.
- Record custom test properties and markers as separate CSV columns for detailed test categorization and filtering.
- Automate test result aggregation across multiple test runs for historical tracking and performance monitoring.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that exports test results to CSV format with customizable columns, delimiters, and the ability to include test metadata like duration, status, markers, and parameters.
Yes, if you have a stable test suite and need CSV output for reporting or data analysis. No, if you require ongoing maintenance, compatibility with the latest pytest versions, or support for new features—the project is abandoned (last release April 2021) and shows no signs of active development. Evaluate whether your pytest version and Python environment are compatible before committing to it in a new project.
Install
pytest-csv on PyPI
pip
pip install pytest-csvuv
uv add pytest-csvpoetry
poetry add pytest-csvInstalling pytest-csv
Before you install
Low install friction with only two runtime dependencies (pytest and six). However, the package is abandoned—last release was 2021-04-22, over 1940 days ago, with no recent commits. Use only if your test infrastructure is stable and you do not expect ongoing maintenance or compatibility updates.
License in practice
Licensed under GPLv3 (copyleft). Any project that uses this plugin must comply with GPLv3 terms, including making source code available under the same license if distributed. This is a significant constraint for proprietary or closed-source projects.
Quickstart
pip install pytest-csv
py.test --csv tests.csv
# With custom columns:
py.test --csv results.csv --csv-columns host,function,status,duration
Verify before relying
- Whether the plugin remains compatible with pytest versions released after 2021-04-22, particularly recent major versions.
- Whether the six dependency is still necessary or if it can be removed for modern Python 3 environments.
Package facts
| License | GPLv3 (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pytest, six |
| Maintenance | abandoned — 1,940 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 551,864/month — #6,046 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_csv-3.0.0-py2.py3-none-any.whl
Keywords: py.test, pytest, csv, tsv, report
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pytest-reportlogWrites pytest test results to a JSON Lines file…
permissive · top 15,000 on PyPI
pytest-mdGenerates Markdown test reports from pytest…
permissive · top 15,000 on PyPI
pytest-md-reportA pytest plugin that generates test outcome…
permissive · top 15,000 on PyPI
detect-delimiterDetects the delimiter character used in CSV,…
permissive · top 15,000 on PyPI
pytest-durationsA pytest plugin that measures and reports…
permissive · top 5,000 on PyPI
pytest-excelA pytest plugin that generates Excel reports…
permissive · top 15,000 on PyPI
csv-diffCompares two CSV, TSV, or JSON files and…
permissive · top 15,000 on PyPI
pytest-progressA pytest plugin that displays real-time test…
permissive · top 15,000 on PyPI
pyexcel-ioProvides a unified API to read and write data…
permissive · top 5,000 on PyPI
pytest-fail-slowA pytest plugin that marks tests as failed if…
permissive · top 15,000 on PyPI