--- id: pytest-reportlog version: "1.0.0" license: MIT license_treatment: permissive maintenance: active --- # pytest-reportlog — Replacement for the --resultlog option, focused in simplicity and extensibility License: permissive · Maintenance: active · Downloads: 801.9K/mo ## What it is and what it does pytest-reportlog is a pytest plugin that captures test execution events and writes them as JSON Lines to a file, one self-contained JSON object per line. It was created as a modern replacement for pytest's deprecated --resultlog option, focusing on simplicity and extensibility. Each line contains a report object with a $report_type identifier (e.g., SessionStart, TestReport, SessionFinish) plus event-specific fields like outcome, duration, and failure details. The file is flushed after each write, enabling real-time consumption by external systems. The plugin supports automatic compression via common suffixes (.gz, .bz2, .xz) and includes a record_property fixture for attaching custom metadata to individual tests. It runs as a pytest plugin with no special configuration beyond installing the package and passing --report-log=FILE to pytest. The output format is designed for forward compatibility: consumers should ignore unrecognized report types and unknown keys, as future pytest versions may extend the objects. Use it for: - Export test results to a structured format for CI/CD pipelines to parse and aggregate across multiple test runs. - Stream test events in real-time to a monitoring system or dashboard during long test sessions. - Attach custom properties (price, environment, build ID) to individual tests for post-analysis and reporting. - Archive test execution history in compressed JSON Lines format for audit trails or compliance. - Integrate pytest results with external tools that consume JSON events without needing custom pytest plugins. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Writes pytest test results to a JSON Lines file in real-time, replacing the deprecated --resultlog option with a simpler, extensible format. Yes. This is a stable, actively maintained plugin with low install friction, no security issues, and a clear use case: anyone migrating from --resultlog or needing structured, real-time test event logging should use it. The MIT license and minimal dependencies make it safe for any project. ## Install pip install pytest-reportlog uv add pytest-reportlog poetry add pytest-reportlog ## Installing pytest-reportlog Before you install: Low friction: pure Python wheel with only pytest as a runtime dependency. Actively maintained with a recent release and no known vulnerabilities. License in practice: MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects. Quickstart: pip install pytest-reportlog pytest your_tests.py --report-log=results.jsonl # Read the JSON Lines output import json with open('results.jsonl') as f: for line in f: event = json.loads(line) print(event['$report_type'], event.get('outcome')) Requires Python 3.10 or later. Verify before relying: - Whether compression formats (.gz, .bz2, .xz) require additional system libraries beyond Python stdlib. - Real-time event processing guarantees and performance characteristics with large test suites. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 801.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest json output, test results logging, pytest report generation, json lines test reporting, pytest result export, test session logging, pytest event streaming, pytest-plugin, json-output, test-reporting [View on SkillFed](https://skillfed.io/packages/pytest-reportlog) · [View on PyPI](https://pypi.org/project/pytest-reportlog/)