This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Camilla Ke
Recipients Camilla Ke
Date 2016-07-01.09:27:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1467365269.89.0.517880663648.issue27432@psf.upfronthosting.co.za>
In-reply-to
Content
Builtin assert methods output messages no matter how length is the output messages.

However, content with exceeding length should be truncated.  

I found an error in the function.

The function is safe_repr() in util.py

if len(result) > _MAX_LENGTH, it should return truncated content, but "short" is default to False. 

unittest/util.py
def safe_repr(obj, short=False):
    try:
        result = repr(obj)
    except Exception:
        result = object.__repr__(obj)
    if not short or len(result) < _MAX_LENGTH:
        return result
    return result[:_MAX_LENGTH] + ' [truncated]...'
History
Date User Action Args
2016-07-01 09:27:49Camilla Kesetrecipients: + Camilla Ke
2016-07-01 09:27:49Camilla Kesetmessageid: <1467365269.89.0.517880663648.issue27432@psf.upfronthosting.co.za>
2016-07-01 09:27:49Camilla Kelinkissue27432 messages
2016-07-01 09:27:49Camilla Kecreate