skillfed

pytest-icdiff

use icdiff for better error messages in pytest assertions

pytest-icdiff v0.9 9.7M downloads/30d#1,512 on PyPI330
Permissive license Unlicense DORMANT released

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

uv

uv add pytest-icdiff

poetry

poetry add pytest-icdiff

Installing 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

Development Status :: 4 - BetaFramework :: PytestIntended Audience :: DevelopersLicense :: Public DomainOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Testing

Tags

pytest assertion diff formattingbetter pytest error messagescolored side-by-side diffspytest icdiff pluginimprove pytest output readability
pytest-plugintest-output-formatting

More Testing packages