【发布时间】:2016-10-05 11:34:51
【问题描述】:
包设置
我已经构建了一个 Python 包,它使用 nose 进行测试。因此,setup.py 包含:
..
test_suite='nose.collector',
tests_require=['nose'],
..
python setup.py test 按预期工作:
running test
...
----------------------------------------------------------------------
Ran 3 tests in 0.065s
OK
使用 XUnit 输出运行
由于我使用的是 Jenkins CI,我想将鼻子结果输出为 JUnit XML 格式:
nosetests <package-name> --with-xunit --verbose
不过,python setup.py test 更加优雅,它无需构建虚拟环境即可安装测试需求。
当通过python setup.py test 调用nose 时,有没有办法将--with-xunit(或任何其他参数)传递给nose?
【问题讨论】:
标签: python command-line-arguments nose setup.py