--- id: pytest-clarity version: "1.0.1" license: MIT license_treatment: permissive maintenance: dormant --- # pytest-clarity — A plugin providing an alternative, colourful diff output for failing assertions. License: permissive · Maintenance: dormant · Downloads: 651.0K/mo ## What it is and what it does pytest-clarity is a pytest plugin that enhances test failure output by replacing the default assertion diff with a colored, side-by-side comparison format inspired by the Ward test framework. When you run pytest with the `-vv` flag, the plugin intercepts failing assertions and renders them with visual highlighting to make differences between expected and actual values easier to spot at a glance. The plugin requires no runtime dependencies and integrates directly into pytest's output pipeline. It offers two configuration options: `--diff-width` to control the width of the diff display, and `--diff-symbols` to force a symbolic representation instead of colored text. However, the package has been dormant since mid-2021, with no recent commits or releases, so compatibility with very recent pytest or Python versions may not be guaranteed. Use it for: - Debugging complex assertion failures in test suites where the default pytest diff is hard to read quickly. - Making test output more readable in CI/CD logs where colored diffs help identify mismatches faster. - Improving developer experience during local test runs by visually highlighting differences in string, dict, or list comparisons. - Reducing time spent parsing assertion errors in large test suites with many failing tests. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that displays colored, side-by-side diffs for failing test assertions, activated with the `-vv` flag and configurable via command-line options. Yes, if you are running pytest on Python 3.6–3.9 and want better visual assertion diffs. The plugin is lightweight, has no dependencies, and is widely downloaded. However, dormancy since 2021 means it may not work with newer pytest or Python versions—verify compatibility with your environment first. If you're on a recent Python or pytest version, test it in a non-critical environment before relying on it. ## Install pip install pytest-clarity uv add pytest-clarity poetry add pytest-clarity ## Installing pytest-clarity Before you install: High install friction: the package is dormant (last release 2021-06-11, last commit 2024-02-18) with no runtime dependencies, but the source distribution requires extraction and installation. Maintenance status suggests it may not receive updates for compatibility with newer pytest or Python versions. License in practice: MIT license (permissive) means you can use, modify, and distribute the package freely with minimal restrictions, provided you include the license notice. Quickstart: pip install pytest-clarity Then run pytest with the -vv flag: pytest -vv --diff-width=60 Requires Python 2.7 or 3.6+ (supports 3.6, 3.7, 3.8, 3.9). The plugin only activates when pytest is run with the -vv option. Verify before relying: - Compatibility with pytest versions released after the package's last update (2021-06-11) is unclear. - Whether the colored diff output works correctly with modern terminal emulators and CI/CD environments. - Performance impact on large test suites with many failing assertions. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: high - Maintenance: dormant - Downloads: 651.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest colored diff output, pytest assertion diff display, pytest test failure visualization, pytest colored test output, pytest diff formatting plugin, pytest assertion comparison, pytest test diff colors, pytest-plugin, test-output, diff-visualization [View on SkillFed](https://skillfed.io/packages/pytest-clarity) · [View on PyPI](https://pypi.org/project/pytest-clarity/)