]> granicus.if.org Git - python/commitdiff
#14832: 'first' now really refers to first arg in unittest assertItemsEqual
authorR David Murray <rdmurray@bitdance.com>
Wed, 16 May 2012 18:01:03 +0000 (14:01 -0400)
committerR David Murray <rdmurray@bitdance.com>
Wed, 16 May 2012 18:01:03 +0000 (14:01 -0400)
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.

Lib/unittest/case.py
Misc/NEWS

index 18dee02675794a5525ec0950c955fcb7e83acb90..f334b5b71d1d6960526843bf494607222c298e13 100644 (file)
@@ -872,7 +872,7 @@ class TestCase(object):
             - [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
index c2be420880e0f41bec1dc14c81a9295c7523c20f..4908f39c2bd94ff8b4e1b934d7950bfd42e2c4b6 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -60,6 +60,9 @@ Core and Builtins
 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