[Python-checkins] cpython (merge 3.5 -> 3.6): Issue #26869: Document unittest.TestCase.longMessage. (Mariatta) (3.5->3.6)

guido.van.rossum python-checkins at python.org
Thu Oct 13 17:24:54 EDT 2016


https://hg.python.org/cpython/rev/d7279d803d1d
changeset:   104479:d7279d803d1d
branch:      3.6
parent:      104476:660058d76788
parent:      104478:7eb4fe57492f
user:        Guido van Rossum <guido at python.org>
date:        Thu Oct 13 14:24:23 2016 -0700
summary:
  Issue #26869: Document unittest.TestCase.longMessage. (Mariatta) (3.5->3.6)

files:
  Doc/library/unittest.rst |  24 +++++++++++-------------
  1 files changed, 11 insertions(+), 13 deletions(-)


diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -1316,19 +1316,17 @@
 
    .. attribute:: longMessage
 
-      If set to ``True`` then any explicit failure message you pass in to the
-      :ref:`assert methods <assert-methods>` will be appended to the end of the
-      normal failure message.  The normal messages contain useful information
-      about the objects involved, for example the message from assertEqual
-      shows you the repr of the two unequal objects. Setting this attribute
-      to ``True`` allows you to have a custom error message in addition to the
-      normal one.
-
-      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.
+      This class attribute determines what happens when a custom failure message
+      is passed as the msg argument to an assertXYY call that fails.
+      ``True`` is the default value. In this case, the custom message is appended
+      to the end of the standard failure message.
+      When set to ``False``, the custom message replaces the standard message.
+
+      The class setting can be overridden in individual test methods by assigning
+      an instance attribute, self.longMessage, to ``True`` or ``False`` before
+      calling the assert methods.
+
+      The class setting gets reset before each test call.
 
       .. versionadded:: 3.1
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list