Message341792
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. |
|
Date |
User |
Action |
Args |
2019-05-07 17:49:38 | gregory.p.smith | set | recipients:
+ gregory.p.smith, r.david.murray, Camilla Ke, Mariatta, cheryl.sabella, jiliuk |
2019-05-07 17:49:38 | gregory.p.smith | set | messageid: <1557251378.0.0.324393533996.issue27432@roundup.psfhosted.org> |
2019-05-07 17:49:37 | gregory.p.smith | link | issue27432 messages |
2019-05-07 17:49:37 | gregory.p.smith | create | |
|