{"library":"pytest-icdiff","title":"pytest-icdiff","description":"pytest-icdiff is a plugin for the pytest testing framework that significantly improves the readability of assertion error messages. By leveraging the `icdiff` utility, it provides clear, colorized, side-by-side diffs for failed equality assertions (assert ==), making it easier to pinpoint differences in complex data structures like dictionaries and lists. The current stable version is 0.9, released in December 2023, and it generally maintains an active development status with compatibility for Python 3.7 and newer.","language":"python","status":"active","last_verified":"Thu Apr 09","install":{"commands":["pip install pytest-icdiff"],"cli":null},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pytest\n\n# test_example.py\ndef test_dictionary_comparison_failure():\n    expected_data = {\"name\": \"Alice\", \"age\": 30, \"city\": \"New York\"}\n    actual_data = {\"name\": \"Bob\", \"age\": 31, \"city\": \"London\", \"occupation\": \"Engineer\"}\n    assert expected_data == actual_data\n\ndef test_list_comparison_failure():\n    expected_list = [1, 2, 3, \"a\", 5]\n    actual_list = [1, 2, 4, \"b\", 5]\n    assert expected_list == actual_list\n\n# To run this example, save it as a .py file (e.g., test_example.py)\n# and execute `pytest -q test_example.py` in your terminal.\n# pytest-icdiff will automatically enhance the output for failed assertions.","lang":"python","description":"After installing `pytest-icdiff`, its functionality is automatically enabled for `pytest` runs. Create a simple test file with failing `assert ==` comparisons to see the enhanced, colorized, side-by-side diffs in action.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]},"compatibility":null}