[issue26869] unittest longMessage docs

Terry J. Reedy report at bugs.python.org
Wed Apr 27 13:35:15 EDT 2016


Terry J. Reedy added the comment:

Replace existing description with

"This class attribute determines what happens when a custom failure message is passed as the msg argument to an assertXYY call that fails.  If True, the default, the custom message is appended to the end of the standard failure message.  If False, the custom message replaces the standard message.

The standard failure message for each *assert method* contains useful information about the objects involved.  For example the message from assertEqual shows the repr of the two unequal objects.  It is usually easier to augment rather than replace this 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.

New in version 3.1."

----------
nosy: +terry.reedy
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26869>
_______________________________________


More information about the Python-bugs-list mailing list