notests -h 无法运行并出现错误
我怀疑我没有正确安装nosetests。 我使用了 easy_install 鼻子 - 输出是
Searching for nose
Best match: nose 1.0.0
Processing nose-1.0.0-py2.7.egg
nose 1.0.0 is already the active version in easy-install.pth
Installing nosetests-script.py script to C:\Python27\Scripts
Installing nosetests.exe script to C:\Python27\Scripts
Installing nosetests-2.7-script.py script to C:\Python27\Script
Installing nosetests-2.7.exe script to C:\Python27\Scripts
所以它看起来安装得很好。但是当我运行nosetests -h 时,
PS C:\Users\john\code\python> nosetests -h
Traceback (most recent call last):
File "C:\Python27\Scripts\nosetests-script.py", line 9, in <module>
load_entry_point('nose==1.0.0', 'console_scripts', 'nosetests')()
File "C:\Python27\lib\site-packages\nose-1.0.0-py2.7.egg\nose\core.py", line 118, in __init__
**extra_args)
TypeError: __init__() got an unexpected keyword argument 'exit'
我是否错过了某个设置步骤?
I suspect I failed to install nosetests correctly.
I used easy_install nose - output was
Searching for nose
Best match: nose 1.0.0
Processing nose-1.0.0-py2.7.egg
nose 1.0.0 is already the active version in easy-install.pth
Installing nosetests-script.py script to C:\Python27\Scripts
Installing nosetests.exe script to C:\Python27\Scripts
Installing nosetests-2.7-script.py script to C:\Python27\Script
Installing nosetests-2.7.exe script to C:\Python27\Scripts
So it looks like it installs fine. But when I run nosetests -h
PS C:\Users\john\code\python> nosetests -h
Traceback (most recent call last):
File "C:\Python27\Scripts\nosetests-script.py", line 9, in <module>
load_entry_point('nose==1.0.0', 'console_scripts', 'nosetests')()
File "C:\Python27\lib\site-packages\nose-1.0.0-py2.7.egg\nose\core.py", line 118, in __init__
**extra_args)
TypeError: __init__() got an unexpected keyword argument 'exit'
Did I miss a setup step somehow?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
诡异的。在
nose/core.py
中,TestProgram
构造函数调用父构造函数,如下所示:unittest/main.py< 中的
TestProgram
构造函数/code> 接受exit
参数:所以...我不知道这个错误是如何发生的。您是否安装了更多版本的Python?您的鼻子测试是否真的使用了适用于 Python 2.7 的正确
unittest
模块?您可以查看unittest\main.py
(C:\Python27
中的某处)并检查TestProgram
构造函数,它是否具有 <代码>退出参数?Weird. In
nose/core.py
theTestProgram
constructor calls the parent constructor like this:Constructor of
TestProgram
inunittest/main.py
accepts theexit
argument:So... I don't know how this error could happen. Do you have more versions of Python installed? Is your nosetests really using the correct
unittest
module for Python 2.7? Can you look atunittest\main.py
(somewhere in yourC:\Python27
) and check theTestProgram
constructor, whether it has anexit
argument?