pytest-tldr

raw JSON →
0.2.6 verified Mon Apr 27 auth: no python

A pytest plugin that limits output to just the things you need, stripping verbose tracebacks and summarizing failures. Current version 0.2.6, infrequent updates.

pip install pytest-tldr
error ModuleNotFoundError: No module named 'pytest_tldr'
cause Plugin not installed or not in the same Python environment.
fix
Run: pip install pytest-tldr
error pytest: error: unrecognized arguments: --tldr
cause Plugin not registered or pytest version too old (<6).
fix
Install plugin: pip install pytest-tldr. Ensure pytest >=6.
gotcha pytest-tldr is only compatible with Python >=3.10. If you use an older Python, installation fails or plugin doesn't load.
fix Upgrade Python to 3.10 or later.
gotcha The plugin requires pytest >=6 (for v0.2.4+) or >=7.2 (for v0.2.5+). Using an older pytest version may cause compatibility errors.
fix Ensure pytest version meets requirement: pip install 'pytest>=7.2'
deprecated Older versions (before 0.2.4) used '--tldr' as a boolean flag; later versions support it as a value flag (e.g., --tldr=short). Check docs if using older style.
fix Update to latest version and use --tldr=<mode> if needed.

Create tests and run with --tldr flag to suppress verbose output.

# Write a test file (e.g., test_example.py)
def test_pass():
    assert 1 + 1 == 2

def test_fail():
    assert 1 + 1 == 3

# Run: pytest --tldr test_example.py