unittest.TestCase.longMessage

longMessage

If set to True then any explicit failure message you pass in to the 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.

New in version 3.1.

doc_python
2016-10-07 17:46:27
Comments
Leave a Comment

Please login to continue.