Python 将测试结果保存在自定义xml文件中

Python 将测试结果保存在自定义xml文件中,python,xml,unit-testing,nose,nosetests,Python,Xml,Unit Testing,Nose,Nosetests,如何将测试结果保存到位于特定文件夹中的自定义xml文件中 我的目录结构是: /MyApp /TestSuites /Logs 我的测试用例位于/TestSuites中一个名为tests.py的文件中 当我尝试跑步时: nosetests tests.py --xunit-file=../Logs/testlog.xml 没有生成xml文件。我想出来了,我所要做的就是像这样执行它: nosetests tests.py --with-xunit

如何将测试结果保存到位于特定文件夹中的自定义xml文件中

我的目录结构是:

    /MyApp
      /TestSuites
      /Logs
我的测试用例位于/TestSuites中一个名为tests.py的文件中

当我尝试跑步时:

    nosetests tests.py --xunit-file=../Logs/testlog.xml

没有生成xml文件。

我想出来了,我所要做的就是像这样执行它:

    nosetests tests.py --with-xunit --xunit-file=../Logs/testlog.xml

如果在命令行中输入以下内容以供将来参考:

$ nosetests --help
这为鼻测试提供了一系列选项,包括所需参数,即:

--with-xunit

您需要添加
--with xunit
选项吗?是的,我已经解决了,我所要做的就是这样执行:nosetests tests.py--with xunit--xunit file=../Logs/testlog.xml