jeudi 4 juin 2015

How to set sys.tracebacklimit = 0 for Failures in unittest.TestResult?

I am using HTMLTestRunner to generate report of my tests. In order to add more readability, I want to remove the traceback from my HTML report.

I found that if I set sys.tracebacklimit = 0 traceback for Errors will be set to minimal but traceback of Failures does not change.

I wanted to access to failure tracebacks using unittest.TestResult.failures but I was not successful. Do anybody knows any workaround? any changes that I can make in HTMLTestRunner or any decorator to be used on addFailure so the traceback does not appear on the html report?

Aucun commentaire:

Enregistrer un commentaire