Pytest: Suggestion: error output improvement

Created on 13 Mar 2020  路  1Comment  路  Source: pytest-dev/pytest

Hi 馃憢 I'm really enjoying the new improvements around test output/syntax highlighting as that's always been an area I felt has had room for improvement.

I was wondering what your thoughts were about adding a little bit of colour to the diff "error" output (i.e. the red lines that begin with the letter E)? I think it really helps draw your eyes to the information you care about after doing some experimenting with it in my own project. I'll just post some pictures to express my suggestion rather than trying to explain it:

This is the current output:
Screenshot 2020-03-13 at 19 31 28

My suggestion (I'm only suggesting the colours, not that we swap the ordering -- ignore that difference 馃槃):
Screenshot 2020-03-13 at 19 51 38

This could be disabled via a command line flag or config option.

Interested in hearing what the community thinks! :)

reporting enhancement

Most helpful comment

Hi @darrenburns! 馃憢

Oh definitely, adding syntax highlight to tracebacks is just the first step we plan to add. Coloring diffs is definitely something we have in mind, surely inspired by pytest-clarity and ward. 馃憤

I believe right now we have to think how to properly integrate arbitrary coloring to text in our terminal writer. @blueyed has mentioned an idea of integrating with the Pygments streaming protocol, that's one idea.

>All comments

Hi @darrenburns! 馃憢

Oh definitely, adding syntax highlight to tracebacks is just the first step we plan to add. Coloring diffs is definitely something we have in mind, surely inspired by pytest-clarity and ward. 馃憤

I believe right now we have to think how to properly integrate arbitrary coloring to text in our terminal writer. @blueyed has mentioned an idea of integrating with the Pygments streaming protocol, that's one idea.

Was this page helpful?
0 / 5 - 0 ratings