扩建 +鼻子因传递的选项而失败
在我的项目上运行构建操作后,我可以使用以下命令运行 nose
:
# ./bin/nosetests
----------------------------------------------------------------------
Ran 0 tests in 0.310s
但是,当我尝试传递选项(例如用于基本目录的 -w
)时,我得到以下信息:
# ./bin/nosetests -vv --detailed-errors --exe
Usage: nosetests [options]
nosetests: error: no such option: -v
我已经检查了正在运行的测试文件,并删除了导入 getopt
或 OptionParser
的所有行,以确保它们不会妨碍,但我仍然遇到相同的错误,
我相信我们正在测试的文件之一需要 getopt
才能运行...有什么方法可以获取 nosetests
吗? > 使用构建时不会出现这些错误?
After running a buildout operation on my project, I can run nose
with the following command:
# ./bin/nosetests
----------------------------------------------------------------------
Ran 0 tests in 0.310s
However, when I try to pass options (such as -w
for the base directory, I get the following:
# ./bin/nosetests -vv --detailed-errors --exe
Usage: nosetests [options]
nosetests: error: no such option: -v
I've checked the test files which are being ran, and removed all lines importing either getopt
or OptionParser
to ensure they're not getting in the way, but I'm still getting the same error regardless.
I believe one of the files we're testing requires getopt
to function... is there any way I can get nosetests
to work with buildout without these errors?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 noserunner 构建配方
这是示例 buildout.cfg:
这将在 bin 目录中创建脚本
test
。运行程序将运行在working-directory
中设置的路径中找到的所有测试You can use noserunner buildout recipe
Here is example buildout.cfg:
This will create script
test
in bin directory. Runner will run all tests found in path set inworking-directory