Python unittests in Jenkins?

前端 未结 6 602
长情又很酷
长情又很酷 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:54

    python -m pytest --junit-xml=pytest_unit.xml source_directory/test/unit || true # tests may fail
    

    Run this as shell from jenkins , you can get the report in pytest_unit.xml as artifact.

提交回复
热议问题