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)
似乎没有办法用
doctest
本身来实现这一点。在如果您通过nose或{a2}这样的测试运行程序运行doctest,那么这些工具可以选择将测试输出作为junitxml返回。在
史蒂文的建议是正确的,鼻子才是正确的。下面是实现该操作的代码:
相关问题 更多 >
编程相关推荐