我有兴趣将一个Python项目的doctests作为Bamboo构建的一部分来运行。有没有办法配置doctest来输出JUnit可解析的xml文件?
答案 0 :(得分:1)
答案 1 :(得分:0)
史蒂文的建议是正确的 - 鼻子是要走的路。这是代码:
if __name__ == "__main__":
import nose
# First argument is a dummy
# --with-doctest enables parsing the doctests
# --with-xunit and --xunit-file generate output files compatible with a JUnit parser (i.e. for Bamboo)
# The last argument is the name of the file to run tests on
argv = ["", "--with-doctest", "--with-xunit", "--xunit-file=" + __file__ + ".xml", __file__]
nose.run(argv=argv)