我无法通过测试来测试新安装的 Python 熊猫库。我没有这台机器的root访问权限,所以我用easy_install在本地安装了pandas:
$ easy_install --prefix=$HOME/.local pandas
... (Success) ...
$ python
>>> import pandas
>>>
但是在 pandas 上运行鼻子测试的几次尝试都失败了:
$ 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)的另一台机器上,我得到了所需的输出:
$ nosetests pandas
...
Ran 3131 tests in 253.226s
OK (SKIP=116)
有没有办法告诉nosetests 本地安装模块的源目录和测试目录在哪里?