Message370973
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. |
|
Date |
User |
Action |
Args |
2020-06-08 11:25:50 | EmilBode | set | recipients:
+ EmilBode |
2020-06-08 11:25:50 | EmilBode | set | messageid: <1591615550.57.0.325345327913.issue40909@roundup.psfhosted.org> |
2020-06-08 11:25:50 | EmilBode | link | issue40909 messages |
2020-06-08 11:25:50 | EmilBode | create | |
|