2👍
✅
Usually this has to do with coverage.py being started too late in the process. The simplest way to ensure it starts early enough is to run the test runner under coverage:
$ coverage run nosetests.py ....
One relevant detail of urls.py: it contains only code that executes when it is imported. So the entire file is executed when Django starts up and imports urls.py. This is different than most files, which define classes or functions whose bodies are executed later.
Source:stackexchange.com