【问题标题】:Save nosetests results in custom xml file将鼻子测试结果保存在自定义 xml 文件中
【发布时间】:2014-07-08 14:38:50
【问题描述】:

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

我的目录结构是:

    /MyApp
      /TestSuites
      /Logs

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

当我尝试运行时:

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

没有生成xml文件。

【问题讨论】:

  • 是否需要添加--with-xunit选项?
  • 是的,我想通了,我所要做的就是像这样执行它:nosetests tests.py --with-xunit --xunit-file=../Logs/testlog.xml

标签: python xml unit-testing nose nosetests


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

    为了将来参考,如果你在命令行输入以下内容:

    $ nosetests --help
    

    这为鼻子测试提供了一系列选项,包括所需的参数,即:

    --with-xunit
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多