Kaydet (Commit) c377cbfd authored tarafından Raymond Hettinger's avatar Raymond Hettinger

SF bug #715145: unittest.py still uses != in failUnlessEqual

üst dee38ac7
...@@ -285,10 +285,10 @@ class TestCase: ...@@ -285,10 +285,10 @@ class TestCase:
raise self.failureException, excName raise self.failureException, excName
def failUnlessEqual(self, first, second, msg=None): 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. operator.
""" """
if first != second: if not first == second:
raise self.failureException, \ raise self.failureException, \
(msg or '%s != %s' % (`first`, `second`)) (msg or '%s != %s' % (`first`, `second`))
......
...@@ -73,6 +73,10 @@ Extension modules ...@@ -73,6 +73,10 @@ Extension modules
Library 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 - sgmllib now supports SGML marked sections, in particular the
MS Office extensions. MS Office extensions.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment