Python startup test with installed application

For some python applications, if I install them manually, I can run python setup.py test inside the application folder to execute test scripts. But if I install them through pip, there is only a .egg file in dist packages, so how should I run their test?

+7
source share
1 answer

I did the following in virtualenv and was able to run the tests.

 $ pip install pyelasticsearch $ pip install nose virtualenv scripttest mock $ cdsitepackages #virtualenvwrapper shortcut to go to the site-packages directory $ cd pyelasticsearch/tests $ nosetests 

Depending on where your site directory is located, you are likely to replace cdsitepackages with something else. As @thaven mentioned, there are two directories created - one that is pyelasticsearch-0.5-py2.7.egg-info / and one that is pyelasticsearch. If the pyelasticsearch package was not really there, you could not import anything.

+3
source

All Articles