--- id: pytest-regressions version: "2.11.0" license: MIT license_treatment: permissive maintenance: active --- # pytest-regressions — Easy to use fixtures to write regression tests. License: permissive · Maintenance: active · Downloads: 1.0M/mo ## What it is and what it does pytest-regressions is a pytest plugin that simplifies writing regression tests by automating the comparison of test output against saved baseline data. Instead of manually writing assertions for complex outputs, you save the expected result once and the fixture automatically verifies that future test runs produce identical data. It handles general data, images, files, and numeric tables through a unified interface. The plugin integrates with pytest-datadir to manage baseline data files in a dedicated directory structure. When a test runs, the fixture compares the current output to the stored baseline; on first run or when you intentionally update baselines, it saves the new data. This approach is particularly useful for testing functions that produce complex, multi-line, or binary output where manual assertion writing would be tedious or error-prone. Use it for: - Verify that refactored code produces identical output to the original implementation. - Test image generation or rendering by comparing pixel data against saved reference images. - Validate formatted reports, logs, or structured text output remains unchanged across releases. - Regression-test numeric computation results (tables, matrices) against known-good baselines. - Detect unintended changes in file generation or serialization behavior. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides pytest fixtures for writing regression tests that compare current output against saved baseline data (text, images, files, numeric tables). Yes. Low install friction, active maintenance, no known vulnerabilities, and permissive MIT license. The plugin solves a real testing problem—baseline comparison—that would otherwise require boilerplate assertion code. Suitable for any project using pytest that needs to validate complex or binary outputs. ## Install pip install pytest-regressions uv add pytest-regressions poetry add pytest-regressions ## Installing pytest-regressions Before you install: Low friction install with three lightweight runtime dependencies (pytest, pytest-datadir, pyyaml). Active maintenance: last commit 2026-07-27, release 81 days ago. License in practice: MIT license (permissive): you can use this freely in commercial and private projects without restriction or attribution requirement. Quickstart: pip install pytest-regressions # In your test file: import pytest def test_output(data_regression): result = some_function() data_regression.check(result) Requires Python 3.10 or later. Verify before relying: - Exact API surface and supported data types (text, images, files, numeric tables) beyond the description excerpt. - How baseline data is stored and managed in the data directory structure. - Whether image comparison includes pixel-level tolerance or only exact matching. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags regression testing pytest, baseline comparison testing, golden file testing, pytest fixtures data comparison, snapshot testing pytest, test output validation, regression-testing, pytest-plugin, baseline-comparison [View on SkillFed](https://skillfed.io/packages/pytest-regressions) · [View on PyPI](https://pypi.org/project/pytest-regressions/)