Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 572
Freewind Avatar asked Sep 06 '10 14:09

Freewind


2 Answers

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
like image 154
ronnix Avatar answered Sep 20 '22 15:09

ronnix


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)
like image 33
Pēteris Caune Avatar answered Sep 20 '22 15:09

Pēteris Caune