summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/unittest.py4
-rw-r--r--Misc/NEWS4
2 files changed, 6 insertions, 2 deletions
diff --git a/Lib/unittest.py b/Lib/unittest.py
index e85dcd1..d31e251 100644
--- a/Lib/unittest.py
+++ b/Lib/unittest.py
@@ -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`))
diff --git a/Misc/NEWS b/Misc/NEWS
index 2e6c536..a58f363 100644
--- 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.