Exclude system paths from django_coverage
Asked Answered
B

2

7

I'm running django_coverage over a project with the command test_coverage. It's working, but it's including in the output and final calculation code in /usr/local/lib/python2.6/dist-packages. I'm not interested in knowing about the coverage of those modules, only the test coverage for my project. I see in the django_coverage documentation on BitBucket that there is a COVERAGE_PATH_EXCLUDES, but that seems to apply only to subdirectories of the project and not absolute system paths. Also, I see that the default for COVERAGE_MODULE_EXCLUDES is to exclude any imports with "django" in it, but I'm still getting output for /usr/local/lib/python2.6/dist-packages/django.

Any thoughts on how to fix this?

Berkly answered 16/11, 2010 at 14:2 Comment(0)
F
2

Do you have 'django' listed in COVERAGE_PATH_EXCLUDES? I have a similar setup (django 1.1.2, python 2.6) don't see the output for any django packages in my test coverage results. Can you post what you are using for the excludes?

Fumble answered 23/1, 2011 at 15:42 Comment(2)
In my settings file I have COVERAGE_PATH_EXCLUDES = ('django',).Berkly
Sorry, wrong variable. Look at COVERAGE_MODULE_EXCLUDES. Here is what I'm using, COVERAGE_MODULE_EXCLUDES = [ 'tests$', 'settings$', 'urls$', 'common.views.test', 'init', 'django' ]Fumble
I
-1

I'm not using django so I can't confirm this, but is it possible that you have modified the original code settings file rather than including the settings in your own as it says in step 3 (from the readme excerpt below):

Install as a Django app

  1. Place the entire django_coverage app in your third-party apps directory.
  2. Update your settings.INSTALLED_APPS to include django_coverage.
  3. Include test coverage specific settings in your own settings file. See settings.py for more detail.
Inearth answered 23/1, 2012 at 16:3 Comment(2)
This question is not about how to install django coverage but to include/exclude specific application for test.Hackery
@Hackery Wow this is old and I don't remember the details. However I wasn't explaining how to install it but where exupero might have gone wrong when modifying settings for django_coverage.Inearth

© 2022 - 2024 — McMap. All rights reserved.