[Python-checkins] cpython (2.7): #14832: 'first' now really refers to first arg in unittest assertItemsEqual

r.david.murray python-checkins at python.org
Wed May 16 20:01:48 CEST 2012


http://hg.python.org/cpython/rev/ff52583a5576
changeset:   77003:ff52583a5576
branch:      2.7
parent:      77000:30d16d1e5175
user:        R David Murray <rdmurray at bitdance.com>
date:        Wed May 16 14:01:03 2012 -0400
summary:
  #14832: 'first' now really refers to first arg in unittest assertItemsEqual

This appears to have been a mixup introduced when we switched from
'expected/actual' to 'first/second'.  The problem doesn't exist
in the corresponding assertCountEqual method in Python3.

files:
  Lib/unittest/case.py |  2 +-
  Misc/NEWS            |  3 +++
  2 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
--- a/Lib/unittest/case.py
+++ b/Lib/unittest/case.py
@@ -872,7 +872,7 @@
             - [0, 1, 1] and [1, 0, 1] compare equal.
             - [0, 0, 1] and [0, 1] compare unequal.
         """
-        first_seq, second_seq = list(actual_seq), list(expected_seq)
+        first_seq, second_seq = list(expected_seq), list(actual_seq)
         with warnings.catch_warnings():
             if sys.py3kwarning:
                 # Silence Py3k warning raised during the sorting
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -60,6 +60,9 @@
 Library
 -------
 
+- Issue #14832: fixed the order of the argument references in the error
+  message produced by unittest's assertItemsEqual.
+
 - Issue #14829: Fix bisect issues under 64-bit Windows.
 
 - Issue #14777: tkinter may return undecoded UTF-8 bytes as a string when

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list