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 maarten-treewalker
Recipients maarten-treewalker
Date 2017-07-03.17:59:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1499104766.61.0.0657645860519.issue30839@psf.upfronthosting.co.za>
In-reply-to
Content
In a unit test for one of my projects I am comparing tree-structured objects using assertEqual(). Because there can be a few nested levels, the repr() string can exceed the _MAX_LENGTH which is just 80 characters. Not by much, but enough to get shortened and therefore requiring extra effort to figure out where the difference is.

I think it is useful to shorten the messages at some point, to avoid accidentally spamming the log with pages of output that no-one is going to read. However, 80 characters is a length that someone debugging a failing test case can easily deal with. So I think the limit could be set an order of magnitude larger.

Making the maximum length configurable would also solve the issue, but still it would be good to increase the default maximum then, in my opinion.

The discussion of #27432 mentions _MAX_LENGTH customization, but that issue is not primarily about _MAX_LENGTH.
History
Date User Action Args
2017-07-03 17:59:26maarten-treewalkersetrecipients: + maarten-treewalker
2017-07-03 17:59:26maarten-treewalkersetmessageid: <1499104766.61.0.0657645860519.issue30839@psf.upfronthosting.co.za>
2017-07-03 17:59:26maarten-treewalkerlinkissue30839 messages
2017-07-03 17:59:26maarten-treewalkercreate