3

Package Settings

I have built a Python package which uses nose for testing. Therefore, setup.py contains:

..
test_suite='nose.collector',
tests_require=['nose'],
..

And python setup.py test works as expected:

running test
...
----------------------------------------------------------------------
Ran 3 tests in 0.065s

OK

Running with XUnit output

Since I'm using Jenkins CI, I would like to output the nose results to JUnit XML format:

nosetests <package-name> --with-xunit --verbose

However, python setup.py test is far more elegant, and it installs the test requirements without having to build a virtual environment.

Is there a way to pass the --with-xunit (or any other parameter) to nose, when calling nose via python setup.py test?

2 Answers 2

3

You can set nosetests option using setup.cfg

For example in you setup.cfg

[nosetests]
with-xunit=1

Further information can be found at http://nose.readthedocs.io/en/latest/api/commands.html

Sign up to request clarification or add additional context in comments.

Comments

2

Nose provides its own setuptools command (nosetests) which accepts command line arguments:

python setup.py nosetests --with-xunit

More information can be found here: http://nose.readthedocs.io/en/latest/setuptools_integration.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.