Skip to content

Improve pytest's Full diff by coloring it's output #11520

@BenjaminSchubert

Description

@BenjaminSchubert

What's the problem this feature will solve?

The Full diff that pytest shows in -vv mode is very red and hard to read. Missing, common and extra entries all have the same color!

For reference, this is what it looks like:

image

Describe the solution you'd like

This diff is the same kind of diff that people might already be familiar with, typically running git diff. Those are often colored already. There is a pygments lexer for parsing such diffs.

As such, I would propose to enhance the coloring of those diffs when pygments is install, which would give something like:

image

Which I believe is much easier to read and spot differences.

I'd be happy to implement the solution if you would be willing to accept such a change.

This might require passing the terminal writer into the tooling that provides the diff to check whether colors should be enabled however.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: reportingrelated to terminal output and user-facing messages and errors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions