Running into a small problem with some code coverage using nosetests and coverage with a Django web application. I have created a .coveragerc file to exclude a huge amount of code (things like class declarations) but I'm still getting some weird results.
Here is my .coveragerc file:
[run]
omit = ../*migrations*, ../*admin.py
[report]
show_missing = True
exclude_lines =
pragma: no cover
from
= models\.
This is an example of one of the models.py files:
from django.db import models
class Query(models.Model):
variable1 = models.CharField(max_length=100)
variable2 = models.CharField(max_length=100)
variable3 = models.CharField(max_length=100)
variable4 = models.CharField(max_length=100)
variable5 = models.CharField(max_length=100)
id = models.AutoField(primary_key=True)
def some_function(self):
self.variable1 = self.variable2 + self.variable3 + self.variable4 + self.variable 5
return self.variable1
So when I run code coverage, the issue I run into is that despite me telling coverage to explicitly exclude anything with the string "= models.", it still says the lines are missing in the report given through the command line. This is making it very hard to determine which lines I'm actually failing to cover in my test cases. Can anyone offer some insight to this?