1

我正在测试 NoseXUnit 以查看是否可以从某些代码中获取 XML 和覆盖率信息。我发现如果我使用

from testme import testmefunction

鼻子崩溃给出输出:

Traceback (most recent call last):
  File "/opt/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/opt/lib/python2.6/site-packages/nose/util.py", line 622, in newfunc
    return func(*arg, **kw)
TypeError: testmefunction() takes exactly 1 argument (0 given)

即使我只有 import 语句并且根本不使用 testmefunction() 也会出现此消息。我尝试用谷歌搜索答案并浏览代码,但没有发现任何问题。我可以使用以下方法成功导入:

import testme

然后使用 testme.testmefunction()

4

1 回答 1

1

找到了我的问题的答案:

https://github.com/nose-devs/nose/issues/127

重命名了从测试到尝试的所有内容,并且有效。

于 2012-06-11T23:51:28.543 回答