pytest-icdiff
use icdiff for better error messages in pytest assertions
What it is and what it does
pytest-icdiff is a pytest plugin that hooks into assertion failures and replaces pytest's default diff output with ICDiff's colored, side-by-side comparison format. When an `assert ==` fails, instead of seeing a linear diff, you get a structured, color-coded view that makes it easier to spot differences at a glance, especially for complex data structures or multi-line strings.
The plugin requires pytest, icdiff, and pprintpp as runtime dependencies and installs with low friction. It activates automatically once installed—no configuration needed. Maintenance is dormant (no updates since late 2023), but the codebase is stable and compatible with Python 3.7 through 3.11. There are no known security vulnerabilities.
Use it for:
- Debugging test failures involving complex nested data structures where visual clarity matters.
- Comparing multi-line strings or formatted output in assertion failures.
- Making test output more readable in CI/CD logs where color-coded diffs are easier to scan.
- Improving developer experience during local test runs with better visual feedback on assertion mismatches.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that replaces default assertion diff output with colored, side-by-side diffs from ICDiff for easier comparison of mismatched values.
Yes, if you run pytest regularly and want clearer assertion diffs. Installation is frictionless, the license is unrestricted, and there are no security concerns. The dormant maintenance status is a minor consideration—the plugin is stable and unlikely to need updates unless pytest itself changes its assertion internals—but monitor compatibility if you upgrade pytest to versions well beyond 2024.
Install
pytest-icdiff on PyPI
pip
pip install pytest-icdiffuv
uv add pytest-icdiffpoetry
poetry add pytest-icdiffInstalling pytest-icdiff
Before you install
Low friction install with three lightweight runtime dependencies (pytest, icdiff, pprintpp). Maintenance is dormant—last release was 2023-12-05 and no commits since 2024-09-04—but the repository is not archived and the plugin remains compatible with current Python versions (3.7–3.11).
License in practice
Distributed under the Unlicense (public domain), so there are no licensing restrictions on use, modification, or distribution.
Quickstart
pip install pytest-icdiff
# Then run pytest normally; the plugin activates automatically
pytest test_file.py
Verify before relying
- Whether the plugin works correctly with pytest versions released after 2024-09-04.
- Performance impact on test suites with many assertion failures.
Package facts
| License | Unlicense (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — pytest, icdiff, pprintpp |
| Maintenance | dormant — 983 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 9,655,067/month — #1,512 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_icdiff-0.9-py3-none-any.whl
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-clarityA pytest plugin that displays colored,…
permissive · top 15,000 on PyPI
pytest-richA pytest plugin that uses rich to format and…
permissive · top 15,000 on PyPI
icdiffIcdiff displays file differences in a…
permissive · top 5,000 on PyPI
ydiffYdiff displays colored, incremental diffs in a…
permissive · top 15,000 on PyPI
pytest-loggingA pytest plugin that configures Python logging…
permissive · top 15,000 on PyPI
datadiffGenerates human-readable diffs of Python data…
permissive · top 15,000 on PyPI
pytest-snapshotA pytest plugin that enables snapshot…
permissive · top 5,000 on PyPI
pytest-error-for-skipsA pytest plugin that converts skipped tests…
permissive · top 15,000 on PyPI
pytest-find-dependenciesA pytest plugin that identifies dependencies…
permissive · top 5,000 on PyPI
pytest-xvfbA pytest plugin that automatically runs tests…
permissive · top 15,000 on PyPI