[Python-checkins] r87467 - in python/branches/py3k: Doc/library/unittest.rst Lib/unittest/case.py
raymond.hettinger
python-checkins at python.org
Fri Dec 24 01:52:55 CET 2010
Author: raymond.hettinger
Date: Fri Dec 24 01:52:54 2010
New Revision: 87467
Log:
Fix docs and comment for r87454.
Modified:
python/branches/py3k/Doc/library/unittest.rst
python/branches/py3k/Lib/unittest/case.py
Modified: python/branches/py3k/Doc/library/unittest.rst
==============================================================================
--- python/branches/py3k/Doc/library/unittest.rst (original)
+++ python/branches/py3k/Doc/library/unittest.rst Fri Dec 24 01:52:54 2010
@@ -1160,7 +1160,7 @@
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
Modified: python/branches/py3k/Lib/unittest/case.py
==============================================================================
--- python/branches/py3k/Lib/unittest/case.py (original)
+++ python/branches/py3k/Lib/unittest/case.py Fri Dec 24 01:52:54 2010
@@ -1021,7 +1021,7 @@
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:
More information about the Python-checkins
mailing list