Gregory P. Smith <g...@krypto.org> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue27432>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to