Skip to content

Commit 8a726bf

Browse files
committed
config for local coverage reports
1 parent 675ef04 commit 8a726bf

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ docker-compose run --rm app ./manage.py help
104104
* We use [pytest](https://docs.pytest.org/en/latest/contents.html) with the [pytest-django](https://pytest-django.readthedocs.io/en/latest/) plugin for running tests.
105105
* Please add tests for your code when contributing.
106106
* Run the test suite using `docker-compose run --rm app pytest`
107+
* With test coverage report `docker-compose run --rm app pytest --cov-report=term --cov=.`
107108

108109
### Import Postman collection
109110
Postman is a free interactive tool for verifying the APIs of your project. You can download it at postman.com/downloads.

project/.coveragerc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
[run]
2-
include = project/*
3-
omit = *migrations*, *tests*
2+
omit =
3+
*/apps.py,
4+
*/config/*,
5+
*/migrations/*,
6+
*/tests/*,
7+
*/tests.py,
8+
*/*.html,
9+
conftest.py,
10+
manage.py,
411
plugins =
512
django_coverage_plugin

project/requirements/local.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2
99
# ------------------------------------------------------------------------------
1010
mypy==0.720 # https://github.com/python/mypy
1111
pytest==5.1.1 # https://github.com/pytest-dev/pytest
12+
pytest-cov==2.8.1 # https://github.com/pytest-dev/pytest-cov
1213
pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar
1314

1415
# Code quality

0 commit comments

Comments
 (0)