hjwp / pytest-icdiff

better error messages for assert equals in pytest
The Unlicense
311 stars 18 forks source link

short expressions end up far away #6

Closed hjwp closed 6 years ago

hjwp commented 6 years ago

because by default the diffs are between two reprs that are set as being 40 characters long, when you compare two short strings it looks really silly cos they are so far away from each other.

eg

E       assert equals failed
E         3                                       2

think this could be fixed by applying the equivalent of textwrap.dedent but applied to both ends of the two pformat blocks, before passing them to pytest. would need some logic to keep them the same width... maybe?