This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author EmilBode
Recipients EmilBode
Date 2020-06-08.11:25:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1591615550.57.0.325345327913.issue40909@roundup.psfhosted.org>
In-reply-to
Content
Found as a comment on SO (https://stackoverflow.com/questions/12813633/how-to-assert-two-list-contain-the-same-elements-in-python#comment104082703_31832447):

In unittest, `self.assertCountEqual({1: [1, 2, 3]}, {1: [5, 6, 7]})` succeeds, even though the two are different.
In this simple case, using assertCountEqual is unnecessary, but there may be cases where a user wants to test for general equality regardless of order.

Note that `self.assertCountEqual([{1: [1, 2, 3]}], [{1: [5, 6, 7]}])` (where both are a list, with only a dict-element), does fail.
And comparing 2 dicts with different keys also fails as expected.
History
Date User Action Args
2020-06-08 11:25:50EmilBodesetrecipients: + EmilBode
2020-06-08 11:25:50EmilBodesetmessageid: <1591615550.57.0.325345327913.issue40909@roundup.psfhosted.org>
2020-06-08 11:25:50EmilBodelinkissue40909 messages
2020-06-08 11:25:50EmilBodecreate