在使用easy_install本地安装的模块上运行鼻子测试 [英] running nosetests on module locally installed with easy_install

查看:85
本文介绍了在使用easy_install本地安装的模块上运行鼻子测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法通过鼻子测试来测试新安装的Python pandas库.我没有root权限可以访问这台机器,所以我使用easy_install在本地安装了熊猫:

I can't get nosetests to test a newly installed Python pandas library. I don't have root access to this machine, so I installed pandas locally with easy_install:

$ easy_install --prefix=$HOME/.local pandas
... (Success) ...
$ python
>>> import pandas
>>>

但是对熊猫进行鼻子测试的几次尝试都失败了:

But several attempts to run nosetests on pandas have failed:

$ nosetests pandas
Ran 0 tests in 0.001s
OK

$ nosetests ~/.local/lib/python2.7/site-packages/pandas-0.11.0-py2.7-linux-x86_64.egg/pandas/tests/
Ran 0 tests in 0.000s
OK

$ nosetests ~/.local/lib/python2.7/site-packages/pandas-0.11.0-py2.7-linux-x86_64.egg/pandas/tests/*
...
Ran 3344 tests in 79.525s

FAILED (SKIP=52, errors=101, failures=10)

我假设最后一次失败是因为鼻子测试无法找到某些源文件.在具有不同安装方式的另一台计算机(Canopy Python)上,我得到了所需的输出:

I'm assuming the last failure is because some of the source files can't be found by nosetests. On a different machine with a different installation (Canopy Python), I get the desired output:

$ nosetests pandas
...
Ran 3131 tests in 253.226s

OK (SKIP=116)

有没有办法告诉鼻子测试本地安装的模块的源目录和测试目录在哪里?

Is there a way to tell nosetests where both the source and test directories of a locally-installed module are?

推荐答案

遇到了同样的问题,我不得不运行它:

had the same problem, I had to run this:

sudo nosetests /usr/lib64/python2.7/site-packages/pandas-0.14.0-py2.7-linux-x86_64.egg/pandas /tests/*.py

我没有解释,但是结果是:

I do not have an explanation for it, but the results is:

在166.166秒内进行了4261次测试 确定(SKIP = 42)

Ran 4261 tests in 166.166s OK (SKIP=42)

这篇关于在使用easy_install本地安装的模块上运行鼻子测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆