patroqueeet
patroqueeet

Reputation: 774

Django nose to run only project tests

I added nose, django-nose, nose-exclude, coverage to my buildout.cfg and ran buildout. Furthermore I added the TEST_RUNNER and the NOSE_ARGS to my settings.py. In the last step I created a exclude_dirs.txt and included it into the NOSE_ARGS. That worked so far.

Finally I ran bin/django testto run the tests of my project. I found out that every app inside INSTALLED_APP is run and that even parts of the django core models are run. How can I limit this to my project only without exernal packages?

Upvotes: 4

Views: 2588

Answers (1)

apcelent
apcelent

Reputation: 1651

In your settings.py file you can do the following:

TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = [
'--cover-package=your_app_name',
'--with-coverage', 
]

Assuming you have added all the reqd. apps to settings.py file in INSTALLED_APPS. This will fix the issue!

Upvotes: 7

Related Questions