running nosetests on module locally installed with

2019-07-16 15:19发布

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)

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?

1条回答
放荡不羁爱自由
2楼-- · 2019-07-16 16:00

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:

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

查看更多
登录 后发表回答