Freewind
Freewind

Reputation: 198328

nosetests --with-pylons test.ini => Error: no such option: --with-pylons

I followed the application to run the tests of pylons project:

http://pylonshq.com/docs/en/0.9.7/i18n/#testing-the-application

But when I run:

 nosetests --with-pylons test.ini

It reports an error:

E:\pylons\helloworld>nosetests --with-pylons test.ini
Usage: nosetests-script.py [options]

nosetests-script.py: error: no such option: --with-pylons

Why nosetests doesn't know the --with-pylons, how to fix it?

Upvotes: 5

Views: 3984

Answers (4)

loyalBrown
loyalBrown

Reputation: 1526

If you've installed the latest version of pylons using pip, version 1.0.1rc1 is installed. Nose is not able to find the pylons-plugin.

To fix this downgrade to pylons 1.0.

pip uninstall pylons
pip install pylons==1.0

I had the same problem and found the solution here

Upvotes: 0

ronnix
ronnix

Reputation: 1564

If you are using Pylons 1.0.1, the nose plugin is not registered by Pylons itself any more.

A workaround is to add this to the entry_points section of your own project's setup.py:

[nose.plugins]
pylons = pylons.test:PylonsPlugin

Upvotes: 8

Pēteris Caune
Pēteris Caune

Reputation: 45182

This error happens in cases where nose cannot find installed pylons. This can happen if nose is installed system-wide (for example, via apt-get install python-nose), but Pylons is installed in virtual environment. In that case you can either:

  • Install Pylons system-wide, that would pollute your global environment and defeat the purpose of having virtual environment
  • Install nose in virtual environment (easy_install -U nose when virtual environment is activated)

Upvotes: 3

Antoine Leclair
Antoine Leclair

Reputation: 18050

I never used --with-pylons. When I am in the directory of the project, nosetests does the job without any parameters.

I'm on Linux, with the proper virtualenv activated. Maybe it's different on Windows.

Upvotes: -2

Related Questions