在Python包中使用Nose和NoseXUnit

4 投票
1 回答
1490 浏览
提问于 2025-04-15 18:08

这是之前的一篇帖子,讲述了如何为Python设置持续集成(CI)。提问者和回答者讨论了如何在他们的构建中使用NoseNoseXUnit与Hudson配合使用。不过,当在任何包含init.py文件的源文件夹中运行NoseXUnit时,会出现一个错误:

File "build/bdist.linux-x86_64/egg/nosexunit/tools.py", line 59, 
    in packages nosexunit.excepts.ToolError: following folder can not contain 
    __init__.py file: /home/dev/source/web2py/applications

我想不出我的源文件夹中有哪个不是包的。使用NoseXUnit时,我是不是漏掉了什么步骤?

1 个回答

5

你可能不应该使用NoseXUnit,因为它真的过时了,类似的功能在nose版本0.11及以上就已经有了。

从nose的帮助信息来看:

  --with-xunit          Enable plugin Xunit: This plugin provides test results
                        in the standard XUnit XML format. [NOSE_WITH_XUNIT]
  --xunit-file=FILE     Path to xml file to store the xunit report in. Default
                        is nosetests.xml in the working directory
                        [NOSE_XUNIT_FILE]

如果你出于某种原因需要旧版本的nose,可以使用 http://bitbucket.org/durin42/nose-xml/ - 这是一个插件,它变成了--with-xunit这个选项。

撰写回答