Sudhir Jonathan Sudhir Jonathan - 1 month ago 17
Python Question

Nose unable to find tests in ubuntu

Is there any reason why Nose wouldn't be able to find tests in Ubuntu 9.04?

I'm using nose 0.11.1 with python 2.5.4.

I can run tests only if I explicitly specify the filename.
If I don't specify the filename it just says, 0 tests.

The same project runs tests fine on my Mac, so I'm quite stumped!

Answer

Some what related, if you're running tests off of a directory i.e

nosetests ... tests/

where tests is the name of the folder with my tests, and have separate python test functions in one of the .py modules... Your functions have to start with 'test' for nosetests to recognize that as a test you want to run.

for example:

 def test_something():
    ...

nosetests will run this function when executed in this directory while

 def somethin_to_test():
    ...

would not.

Comments