Vitaly added the comment:
Python 2.7 documentation is VERY misleading about the functionality of
assertItemsEqual. It actually claims to compare not only the counts, but the
actual sorted elements themselves. This documentation mislead my group to use
this method for comparing the elements. See
https://hg.python.org/cpython/file/d9921cb6e3cd/Doc/library/unittest.rst:
.. method:: assertItemsEqual(actual, expected, msg=None)
Test that sequence *expected* contains the same elements as *actual*,
regardless of their order. When they don't, an error message listing the
differences between the sequences will be generated.
Duplicate elements are *not* ignored when comparing *actual* and
*expected*. It verifies if each element has the same count in both
sequences. It is the equivalent of ``assertEqual(sorted(expected),
sorted(actual))`` but it works with sequences of unhashable objects as
well.
----------
nosy: +vitaly
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue17866>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com