For Jedi we want to generate our test coverage. There is a related question in stackoverflow, but it didn\'t help.
We\'re using py.test as a test runner. However, w
I had this problem with py.test, the coverage and the django plugin. Apparently the model files are imported before coverage is started. Not even "-p coverage" for early-loading of the coverage-plugin worked.
I fixed it (ugly?) by removing the models module from sys.modules and re-importing it in the test file that tests the model:
import sys
del sys.modules['project.my_app.models']
from project.my_app import models
def test_my_model():
...