4👍
✅
Per the coverage
documentation:
When running your code, the
coverage run
command will by default
measure all code, unless it is part of the Python standard library.
Django isn’t in the standard library, so you will need to specify that it should be excluded, or that only your own code should be included. In your script
you can set the source
(s) for coverage. For example, with the standard myapp
:
script:
- coverage run --source=myapp manage.py test myapp
# ^ set one or more comma-separated sources to cover
Per the Django docs on coverage
integration you can also use --source='.'
to cover all files within the project root.
Source:stackexchange.com