Reputation: 7148
I first noticed the problem with this project when I loaded it into Jenkins. More puzzlingly, I've been able to reproduce it as follows:
In original version of the project, the following command runs tests as expected:
.venv/bin/python setup.py nosetests
I then do the following:
.venv
in cloneIf I then run .venv/bin/python setup.py nosetests
on this version and I get the following result:
setup.py: error: Invalid command nosetests
setup.py
includes the following settings:
setup_requires=[
'nose>=1.0', 'nosexcover', 'coverage', 'selenium', 'fixture'
],
test_suite='nose.collector',
I'm especially baffled because it's the same setup.py
and setup.cfg
files in each version and, as far as I been able to discern, the environments are identical.
I noticed this Stack Overflow question in the sidebar, which looks closely related, but none of the solutions offered there are working in my case.
Upvotes: 5
Views: 3190
Reputation: 81
I ran into the same problem and managed to fix it by putting
setup_requires=['nose>=1.0']
Into my setup.py
file. After that the Python setup.py nosetests
option was available to me.
Some links that were helpful:
Upvotes: 2
Reputation: 7148
I never figured out the underlying issue exactly. But I did figure out a workaround that allowed me to get my build running. This is the command I used in the Virtualenv Builder on Jenkins:
# require nosetests be installed
# (old method using setup.py nosetests command does not work)
$VIRTUAL_ENV/bin/pip install nose
# install remain pip requirements
$VIRTUAL_ENV/bin/pip install -r requirements.pip
# must run this prior to running tests to install other nosetest dependencies
$VIRTUAL_ENV/bin/python setup.py install
# now we can run nosetests
# this does not work: $VIRTUAL_ENV/bin/python setup.py nosetests
$VIRTUAL_ENV/bin/nosetests -c setup.cfg
I suspect the root problem has to do with the state of the virtual environment and some kind of version incompatibility between Distutils and Nose in my new virtualenv. The old one seems to have arrived at a certain precarious configuration over time which cloning and pip alone cannot recreate.
Upvotes: 1