From: Raymond Hettinger Date: Fri, 24 Dec 2010 00:52:54 +0000 (+0000) Subject: Fix docs and comment for r87454. X-Git-Tag: v3.2rc1~356 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6518f5e78060f0d1cbc44b3034427fe0300fb062;p=python Fix docs and comment for r87454. --- diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 9c0f1a1d0d..9e309088b4 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -1160,7 +1160,7 @@ Test cases Duplicate elements are *not* ignored when comparing *actual* and *expected*. It verifies if each element has the same count in both sequences. Equivalent to: - ``assertEqual(Counter(iter(actual)), Counter(iter(expected)))`` + ``assertEqual(Counter(list(actual)), Counter(list(expected)))`` but works with sequences of unhashable objects as well. .. versionadded:: 3.2 diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index 68e53a5953..ad5fe61589 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -1021,7 +1021,7 @@ class TestCase(object): actual = collections.Counter(actual_seq) expected = collections.Counter(expected_seq) except TypeError: - # Unsortable items (example: set(), complex(), ...) + # Handle case with unhashable elements missing, unexpected = unorderable_list_difference(expected_seq, actual_seq) else: if actual == expected: