mirror of
https://github.com/python/cpython.git
synced 2025-10-01 12:52:18 +00:00
Issue #26869: Document unittest.TestCase.longMessage. (Mariatta) (3.6->3.7)
This commit is contained in:
commit
54aced7175
1 changed files with 9 additions and 11 deletions
|
@ -1316,19 +1316,17 @@ Test cases
|
||||||
|
|
||||||
.. attribute:: longMessage
|
.. attribute:: longMessage
|
||||||
|
|
||||||
If set to ``True`` then any explicit failure message you pass in to the
|
This class attribute determines what happens when a custom failure message
|
||||||
:ref:`assert methods <assert-methods>` will be appended to the end of the
|
is passed as the msg argument to an assertXYY call that fails.
|
||||||
normal failure message. The normal messages contain useful information
|
``True`` is the default value. In this case, the custom message is appended
|
||||||
about the objects involved, for example the message from assertEqual
|
to the end of the standard failure message.
|
||||||
shows you the repr of the two unequal objects. Setting this attribute
|
When set to ``False``, the custom message replaces the standard message.
|
||||||
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
|
The class setting can be overridden in individual test methods by assigning
|
||||||
passed to an assert method will silence the normal message.
|
an instance attribute, self.longMessage, to ``True`` or ``False`` before
|
||||||
|
calling the assert methods.
|
||||||
|
|
||||||
The class setting can be overridden in individual tests by assigning an
|
The class setting gets reset before each test call.
|
||||||
instance attribute to ``True`` or ``False`` before calling the assert methods.
|
|
||||||
|
|
||||||
.. versionadded:: 3.1
|
.. versionadded:: 3.1
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue