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 gregory.p.smith
Recipients Camilla Ke, Mariatta, cheryl.sabella, gregory.p.smith, jiliuk, r.david.murray
Date 2019-05-07.17:49:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557251378.0.0.324393533996.issue27432@roundup.psfhosted.org>
In-reply-to
Content
safe_repr() as used internally by unittest wasn't intended to truncate by default as part of its "safety".  The "safe" part is that it catches Exception and provides an alternate repr if the __repr__ raised.

unittest.util.safe_repr() is a public API, just not documented.  Lets take this issue to enhance it a bit and document it.  Additionally as r.david.murray suggested, a way for unittest.TestCase to configure itself to enable safe_repr truncation by default would be nice.

I'm currently thinking a feature similar to the class variable maxDiff. maxReprLength perhaps.
History
Date User Action Args
2019-05-07 17:49:38gregory.p.smithsetrecipients: + gregory.p.smith, r.david.murray, Camilla Ke, Mariatta, cheryl.sabella, jiliuk
2019-05-07 17:49:38gregory.p.smithsetmessageid: <1557251378.0.0.324393533996.issue27432@roundup.psfhosted.org>
2019-05-07 17:49:37gregory.p.smithlinkissue27432 messages
2019-05-07 17:49:37gregory.p.smithcreate