pytest icon indicating copy to clipboard operation
pytest copied to clipboard

Improve diffing algorithm for trivial cases

Open stdedos opened this issue 4 years ago • 3 comments

Hello there! Would improving the diff algorithm be considered / easy-to-do in this case?

E       AssertionError: assert ['scaling', '...en', 'scroll'] == ['score', 'screen', 'scroll']
E         At index 0 diff: 'scaling' != 'score'
E         Left contains one more item: 'scroll'
E         Use -v to get the full diff

>>>

E       AssertionError: assert ['scaling', '...en', 'scroll'] == ['score', 'screen', 'scroll']
E         At index 0 diff: 'scaling' != 'score'
E         Left contains one more item: 'scroll'
E         Full diff:
E         - ['score', 'screen', 'scroll']
E         + ['scaling', 'score', 'screen', 'scroll']
E         ?  +++++++++++

There's "just one more element"; not index 0 != and one more item (which is actually not the extra one).

stdedos avatar Jun 18 '21 15:06 stdedos