Comments (4)
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.
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.
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.
This has now been addressed in #18.
It took a while :]
from ddt.
Related Issues (20)
- Add @named_data to give tests meaningful names. HOT 1
- Consider dropping support for all EOL versions Python 2.7 - 3.6 HOT 1
- How to import `named_data`? HOT 1
- Allow `named_data` to take tuples (any `collections.Sequence`)
- Async tests no longer work on python 3.11
- sdist is missing `tox.ini` HOT 6
- 1.7.0: `flake8` reports `pycodestyle` errors HOT 5
- 1.7.0: Has Python 2.7 classifiers but is Python 3+ only. HOT 2
- ddt interaction with setUp and tearDown HOT 2
- Django runserver finds that @file_data has loaded the data and cannot be changed[Help me] HOT 1
- Test Case Ordinal Numbering zero-pads poorly HOT 1
- Index only test names HOT 1
- New release causes error on import HOT 4
- 1.4.1: test suite is failing HOT 2
- Cleanup
- Docs → Example Usage: contents of example data files not shown? HOT 1
- (DDT+Excel+Unittest)How to control the execution of each test case HOT 2
- Test failure with PyYAML 5.4.1 HOT 4
- Signature change of `ddt.idata` in 1.4.3 breaks downstream uses
- @ifile_data - an iterable @file_data decorator HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ddt.