Merge lp://staging/~mars/zope.testing/fix-subunit-utf8-traceback-reporting into lp://staging/zope.testing
Status: | Merged |
---|---|
Merge reported by: | Benji York |
Merged at revision: | not available |
Proposed branch: | lp://staging/~mars/zope.testing/fix-subunit-utf8-traceback-reporting |
Merge into: | lp://staging/zope.testing |
Diff against target: |
122 lines (+79/-3) 3 files modified
src/zope/testing/testrunner/formatter.py (+16/-3) src/zope/testing/testrunner/test_subunit.py (+59/-0) src/zope/testing/testrunner/tests.py (+4/-0) |
To merge this branch: | bzr merge lp://staging/~mars/zope.testing/fix-subunit-utf8-traceback-reporting |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Benji York (community) | Approve | ||
Sidnei da Silva | Approve | ||
Review via email: mp+27086@code.staging.launchpad.net |
Description of the change
Hello,
This branch fixes a problem in zope.testing's subunit support. Instead of raising an Exception when the traceback contains UTF8-encoded characters we try to handle the text in a robust way. See bug 591309 for the details.
We assume the traceback is in utf-8, as that is the encoding most people would use for a doctest or Python module, but just in case, I included a test for handling other codecs.
This entire patch would be unnecessary if the traceback were guaranteed to be a unicode object. Unfortunately, I do not know the entry points from which a bytestring can be passed into the formatter, so this defensive code feels safer than risking a testrunner to crash. The unicode-type test makes the code forward-compatible.
I exposed the SubunitOutputFo
Maris
Looks good to me. +1!