donkirkby / live-py-plugin

Live coding in Python with PyCharm, Emacs, Sublime Text, or even a browser
https://donkirkby.github.io/live-py-plugin
MIT License
290 stars 57 forks source link

Report max diff in image #533

Closed donkirkby closed 1 year ago

donkirkby commented 1 year ago

What I did

I used a LiveImageDiffer to compare two images in a unit test.

What happened

The test was flaky, and would occasionally fail with an error like this:

AssertionError: Images differ by 716 pixels.

What I wanted to happen

If I decide I want to just work around this by increasing the tolerance, I can't tell how big I need to make it. It would be helpful to add the maximum difference to the error message:

AssertionError: Images differ by 716 pixels with a maximum difference of 1.

The current error message comes from the assert_equal() method.

My environment

Describe the versions of everything you were using: