我正在测试 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()