A. Jesse Jiryu Davis
A. Jesse Jiryu Davis

Reputation: 24007

How to specify which tests to run with "python setup.py nosetests"

Behold, my setup.py:

https://github.com/mongodb/motor/blob/master/setup.py

... and setup.cfg:

https://github.com/mongodb/motor/blob/master/setup.cfg

I'd like to be able to run one suite, like:

python setup.py nosetests test.test_motor_ssl

But I get "invalid command name 'test.test_motor_ssl'". With this, on the other hand:

python setup.py nosetests --tests test.test_motor_ssl

... nosetests runs every test in my project. How can I tell nosetests, when it is running in setup.py, how to run a subset of tests?

Upvotes: 6

Views: 4476

Answers (3)

cmcguire
cmcguire

Reputation: 131

Using nose==1.3.1 I'm able to run a single test class/test case via: python setup.py nosetests --tests tests/test_file.py:TestClass.test_case

Upvotes: 3

Rmatt
Rmatt

Reputation: 1347

The only thing that works now is actually the directory approach. It is still not possible to specify the path...

python setup.py nosetests -w tests/test_folder

Upvotes: 3

user2411718
user2411718

Reputation: 81

Apparently this is a known bug in nose 1.2.1 and they already have a fix in the master branch. You can either wait for the next version or use the nosetests command directly.

source: https://github.com/nose-devs/nose/issues/556

Upvotes: 3

Related Questions