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:
- TestFoo.py
- Foo-Test.py
- Foo_Test.py
- Foo.Test.py (note that this one will try to import Foo, and will raise an exception if it cannot)
A name that looks like it would match, but actually does not:
If you just rename your files you should be good to go.
Update: Have you read
this blog post? I wasn't able to tell from the details you've posted, but maybe your test directories are missing their
__init.py__
files?
... make sure that your “tests” directories are actually modules (they have an empty __init__.py
file).