I'm using django-nose to test our Django projects. It is common to split large test suites inside an application in Django like this:
myapp/
__init__.py
models.py
tests/
__init__.py
test_views.py
test_models.py
views.py
tests/__init__.py
would look like this:
from test_views import *
from test_models import *
Since Django will look for tests in myapp.tests
, everything works as expected. Nose on the other hand will find the tests in tests_*.py
and import them again in __init__.py
. This results in the total number of tests reported being double what they should be.
Any ways around this problem (other than never using sub-modules) that will correctly report the tests with both django-nose and the default Django test runner?