Giter Club home page Giter Club logo

Comments (4)

txels avatar txels commented on August 24, 2024

I am not sure about this. By default this code has no idea whether it is running somewhere that will parse its output and put it inside XML files unescaped. So I believe it is the fault of the software that generates XML not to escape this. Which test runner are you using?

OTOH most runners probably expect this to be a method name and thus XML-safe, so they don't care.

Not sure I will feel this compelling enough to do the work myself, but if you send this as a PR with a proper unit test I will merge it and release it.

from ddt.

dlai0001 avatar dlai0001 commented on August 24, 2024

I'm using nose as my test runner. I'm not too familiar with the internals of the unittest runner to write a proper unit test for this.

What's happening is the data is being used to generate the names used in the xml test results, the data is used as part of the test name, since the names in the unittest results are of the from of "name_of_the_method_THETESTDATA" so alot of my unit test results were looking like,

<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="tests" tests="3" errors="0" failures="0" time="37.787">
<testcase classname="tests.logintests" name="TestLogin.TestLogin.test_login_<LoginTestData(user:badusername, passwd:password, expected:False)>" time="10.894"/>
<testcase classname="tests.logintests" name="TestLogin.TestLogin.test_login_<LoginTestData(user:user1, passwd:badpassword, expected:False)>" time="7.205"/>
<testcase classname="tests.logintests" name="TestLogin.TestLogin.test_login_<LoginTestData(user:user1, passwd:password, expected:True)>" time="19.686"/>
<system-out><![CDATA[]]></system-out><system-err><![CDATA[]]></system-err>
</testsuite>

The XML characters in the 'name' property causes the JUnit Parser plugins on Jenkins and Bamboo to fail.

from ddt.

txels avatar txels commented on August 24, 2024

Thanks for further illustrating the issue. Makes sense to me. Will take your PR if you send one, or else may give it some time later this week.

from ddt.

txels avatar txels commented on August 24, 2024

This has now been addressed in #18.
It took a while :]

from ddt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.