(original) (raw)

Index: Doc/library/unittest.rst =================================================================== --- Doc/library/unittest.rst (revision 86592) +++ Doc/library/unittest.rst (working copy) @@ -1287,8 +1287,8 @@ to ``True`` allows you to have a custom error message in addition to the normal one. - This attribute defaults to ``False``, meaning that a custom message passed - to an assert method will silence the normal message. + This attribute defaults to ``True``. If set to False then a custom message + passed to an assert method will silence the normal message. The class setting can be overridden in individual tests by assigning an instance attribute to ``True`` or ``False`` before calling the assert methods. Index: Lib/unittest/test/test_assertions.py =================================================================== --- Lib/unittest/test/test_assertions.py (revision 86592) +++ Lib/unittest/test/test_assertions.py (working copy) @@ -127,7 +127,7 @@ self.testableFalse = TestableTestFalse('testTest') def testDefault(self): - self.assertFalse(unittest.TestCase.longMessage) + self.assertTrue(unittest.TestCase.longMessage) def test_formatMsg(self): self.assertEquals(self.testableFalse._formatMessage(None, "foo"), "foo") Index: Lib/unittest/case.py =================================================================== --- Lib/unittest/case.py (revision 86592) +++ Lib/unittest/case.py (working copy) @@ -244,7 +244,7 @@ # objects used in assert methods) will be printed on failure in *addition* # to any explicit message passed. - longMessage = False + longMessage = True # This attribute sets the maximum length of a diff in failure messages # by assert methods using difflib. It is looked up as an instance attribute