pytest-icdiff icon indicating copy to clipboard operation
pytest-icdiff copied to clipboard

Don't show indentation or comas in diff

Open erdnaxeli opened this issue 3 years ago • 3 comments

The diff shows indent and coma diff, which useless.

image image

erdnaxeli avatar Mar 30 '22 14:03 erdnaxeli

just to make sure we're on the same page, you'd like to remove non-semantically relevant parts from diffs, is that right?

you're not saying that the test reported an assert equals failure on two objects that are actually the same? that would be very surprising.

i guess one solution would be to try and canonicalise the left and right hand sides. can you think of a way of doing that?

hjwp avatar Apr 23 '22 07:04 hjwp

just to make sure we're on the same page, you'd like to remove non-semantically relevant parts from diffs, is that right?

yes, that's it. It does not make the test fail, but if the test fails those diff are reported.

erdnaxeli avatar Apr 25 '22 07:04 erdnaxeli

gotcha. well i guess you'd need a way to "canonicalize" the whitespace and commas on both sides -- can you think of a way of doing that?

i guess you could do it manually in your tests, before the assert?

hjwp avatar Jul 06 '22 15:07 hjwp