Python unittests in Jenkins?

前端 未结 6 593
长情又很酷
长情又很酷 2020-12-07 07:35

How do you get Jenkins to execute python unittest cases? Is it possible to JUnit style XML output from the builtin unittest package?

6条回答
  •  粉色の甜心
    2020-12-07 07:51

    I would second using nose. Basic XML reporting is now built in. Just use the --with-xunit command line option and it will produce a nosetests.xml file. For example:

    nosetests --with-xunit

    Then add a "Publish JUnit test result report" post build action, and fill in the "Test report XMLs" field with nosetests.xml (assuming that you ran nosetests in $WORKSPACE).

提交回复
热议问题