Answer the question
In order to leave comments, you need to log in
How to make coverage work with django_nose in a django project?
Hello, I've been fiddling
with coverage and django_nose in a project for two days now. One gets the feeling that they are playing a cruel joke with me together, refusing to work correctly. Tell me what am I doing wrong?
Here are the two modules I installed via pip :
coverage
django_nose
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = [
'--with-coverage',
'--cover-html',
'--cover-package=apps.common',
]
from django.test import TestCase
from django.test import Client
from django.core.urlresolvers import reverse
from .models import PuppetRole
class PuppetRoleTest(TestCase):
def test_this_please(self):
w = PuppetRole.objects.create(role="role_1")
self.assertTrue(isinstance(w, PuppetRole))
self.assertEqual(w.__str__(), "role_1")
$ python manage.py test
$ coverage run --branch --source=apps.common ./manage.py test
$ coverage report
Answer the question
In order to leave comments, you need to log in
I forgot to add that I tried to configure all this in Windows. And he was wrong. I tried to do the same on Mac and it worked for me. Windows is evil and that was probably the last time I tried to use it for development.
Yes, I was able to run coverage without django_nose and am happy with the result too.
Issue resolved. Thank you.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question