-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Description
When pytest compares lists of different length and tries to show what the extra items are, it prints incorrect message "Right contains one more item" pointing to the wrong item. At the same time the "Full diff" section correctly indicates extra item. For "Left contains" issue is the same.
Minimal example:
def test_cmp():
> assert ['1', '2', '3'] == ['1', '2', '0', '3']
E AssertionError: assert ['1', '2', '3'] == ['1', '2', '0', '3']
E
E At index 2 diff: '3' != '0'
E Right contains one more item: '3'
E
E Full diff:
E [
E '1',
E '2',
E - '0',
E '3',
E ]
versions:
Ubuntu 22.04.5 LTS
pytest 8.3.3
Metadata
Metadata
Assignees
Labels
No labels