xmlrunner does not support ]]> in error messages and std{out/err}

Bug #1283851 reported by Artur R. Czechowski
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unittest-xml-reporting (Debian)
Fix Released
Unknown
unittest-xml-reporting (Ubuntu)
New
Undecided
Unassigned

Bug Description

Following simple test snippet:

---8<--- [cut] ---8<---
#!/usr/bin/env python
import unittest
import xmlrunner

class Foo(unittest.TestCase):
    def testFoo(self):
        self.assertTrue(False, ']]>')

unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports'))
---8<--- [cut] ---8<---

results with unhandled exception:

ValueError: ']]>' not allowed in a CDATA section

Multiple CDATA sections can be added in a manner that will result with following final output:

---8<--- [cut] ---8<---
        <error message="]]&gt;" type="AssertionError">
<![CDATA[Traceback (most recent call last):
  File "./t.py", line 7, in testFoo
    self.assertTrue(False, ']]]]><![CDATA[>')
AssertionError: ]]]]><![CDATA[>
]]> </error>
---8<--- [cut] ---8<---

Tags: patch
Revision history for this message
Artur R. Czechowski (arturcz) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch fixing this issue." seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in unittest-xml-reporting (Debian):
status: Unknown → Confirmed
Changed in unittest-xml-reporting (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.