ESSS / pytest-regressions

Pytest plugin for regression testing: https://pytest-regressions.readthedocs.io
MIT License
179 stars 35 forks source link

Show pytest-clarity diff if installed #122

Open CarliJoy opened 1 year ago

CarliJoy commented 1 year ago

It would be awesome if pytest-regression would show the clarity diff provided pytest-clarity if pytest-clarity is installed.

Maybe it only has to be changed in a way to use the default pytest pytest_assertrepr_compare for displaying the diff.

Anyway that would be awesome as in our CI runner we can't easily extract the HTML diff files from the temp dir, so the CI output is often the only thing we have for failing tests.

nicoddemus commented 1 year ago

Interesting idea, but it needs investigation if all we needed to do was to detect pytest-clarify + disable our custom diff generation in order to get pytest-clarify's nice diffs.

CarliJoy commented 1 year ago

Probably that all what's needed. An alternative is https://github.com/hjwp/pytest-icdiff which also shows nice diffs.

Probably one just need to determine if a custom diff hook is registered and use the pytest default diff again in this case.

Maybe we should use one if these anyway considering #125.