[TIP] invalid xml characters in junit output with pytest

Ronny Pfannschmidt Ronny.Pfannschmidt at gmx.de
Mon Feb 25 13:43:03 PST 2013

Hi Chris,

what version of pytest (i fixed such an issue a while back)

-- Ronny

On 02/25/2013 05:01 PM, Pella,Chris wrote:
> We have a problem with a test we are running in Jenkins. We are wrapping
> a binary executable with pexpect as part of a test suite. When a failure
> occurs it looks like there are some escape characters e.g. 0x1b that are
> captured in the junit xml output:
> org.xml.sax.SAXParseException  <http://stacktrace.jenkins-ci.org/search?query=org.xml.sax.SAXParseException>: An invalid XML character (Unicode: 0x1b) was found in the element content of the document.
> Consequently, Jenkins doesn’t print the results for the test. I tried
> writing a python script to filter out the invalid xml but it doesn’t
> seem to get executed before the Jenkins junit reporting executes.
> Is there a way to tell the pytest junit plugin to filter these characters?
> Thanks,
> Chris

More information about the testing-in-python mailing list