]> granicus.if.org Git - python/commitdiff
SF bug #715145: unittest.py still uses != in failUnlessEqual
authorRaymond Hettinger <python@rcn.com>
Fri, 4 Apr 2003 22:56:42 +0000 (22:56 +0000)
committerRaymond Hettinger <python@rcn.com>
Fri, 4 Apr 2003 22:56:42 +0000 (22:56 +0000)
Lib/unittest.py
Misc/NEWS

index e85dcd1c73f29dd45b8a16b8eb15b457e7302584..d31e251d4b08d101bd9cdce49e3ab632fe6260ee 100644 (file)
@@ -285,10 +285,10 @@ class TestCase:
             raise self.failureException, excName
 
     def failUnlessEqual(self, first, second, msg=None):
-        """Fail if the two objects are unequal as determined by the '!='
+        """Fail if the two objects are unequal as determined by the '=='
            operator.
         """
-        if first != second:
+        if not first == second:
             raise self.failureException, \
                   (msg or '%s != %s' % (`first`, `second`))
 
index 2e6c5367cdaff251ef7c9df712c2f6ba8c5211e4..a58f3633114ad0198e4c343dd47783a97dfb940a 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -73,6 +73,10 @@ Extension modules
 Library
 -------
 
+- unittest.failUnlessEqual and its equivalent unittest.assertEqual now
+  return 'not a == b' rather than 'a != b'.  This gives the desired
+  result for classes that define __eq__ without defining __ne__.
+
 - sgmllib now supports SGML marked sections, in particular the 
   MS Office extensions.