🧪Test Coverage
Getting a Django Application to 100% Test Coverage
Introduction
Configuring Coverage.py
Install coverage:
pip install coveragepipenv install coverageChecking the installation:
coverage --versionpython -m coverage --version[run]
branch = True
disable_warnings = no-data-collected
omit =
# omit anything in a .local directory anywhere
*/.local/*
*/node_modules/*
# omit everything in /migrations
/migrations/*
# omit this single file
manage.py
[report]
exclude_lines =
pragma: no cover
def __repr__
if self.debug:
if settings.DEBUG
raise AssertionError
raise NotImplementedError
if 0:
if __name__ == .__main__.:
fail_under = 100
show_missing = True
skip_covered = True
ignore_errors = True
[html]
directory = coverage_html_reportLast updated