I am using unittest
for UI testing and HTMLTestRunner to publish test reports. To have more neat reports, I want to remove/disable traceback on output. I found sys.tracebacklimit = 0
effective but it just works on Errors and apparenty error stack is separate from failure stack in unittest.TestResult. How can I have traceback removed from failures as well?
I changed HTMLTestRunner addError
and addFailure
and replaces _exc_str
with " "
. Also you can replace it with any desired string.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.