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!
The other thing which always gets me with nose
is that it won't run tests in executable files. I'm not exactly sure why that would make a difference across Mac/Ubuntu, but it's worth a shot.
Make sure that the scripts didn't somehow get chmod +x
'd on the Mac… And if they did, fix them with chmod -x $(find tests/ -name '*.py')
.
This behavior is almost certainly because your files are not named in accordance with nose's test matching behavior. From the nose docs:
nose collects tests automatically from python source files, directories and packages found in its working directory (which defaults to the current working directory). Any python source file, directory or package that matches the testMatch regular expression (by default: (?:^|[b_.-])[Tt]est) will be collected as a test (or source for collection of tests).
Emphasis was mine.
Some example names that would match:
A name that looks like it would match, but actually does not:
If you just rename your files you should be good to go.
__init__.py
files? ... make sure that your “tests” directories are actually modules (they have an empty
__init__.py
file).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With