🩺(coverage) add config and make rule to compute coverage
Configure pytest-cov settings in pyproject.toml and add make rule to compute test coverage.
This commit is contained in:
committed by
Marie
parent
ca179b8811
commit
c26786a107
1
.gitignore
vendored
1
.gitignore
vendored
@@ -66,6 +66,7 @@ src/frontend/tsclient
|
|||||||
|
|
||||||
# Test & lint
|
# Test & lint
|
||||||
.coverage
|
.coverage
|
||||||
|
coverage.json
|
||||||
.pylint.d
|
.pylint.d
|
||||||
.pytest_cache
|
.pytest_cache
|
||||||
db.sqlite3
|
db.sqlite3
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -166,6 +166,10 @@ test-back-parallel: ## run all back-end tests in parallel
|
|||||||
bin/pytest -n auto $${args:-${1}}
|
bin/pytest -n auto $${args:-${1}}
|
||||||
.PHONY: test-back-parallel
|
.PHONY: test-back-parallel
|
||||||
|
|
||||||
|
test-coverage: ## compute, display and save test coverage
|
||||||
|
bin/pytest --cov=. --cov-report json .
|
||||||
|
.PHONY: test-coverage
|
||||||
|
|
||||||
makemigrations: ## run django makemigrations for the people project.
|
makemigrations: ## run django makemigrations for the people project.
|
||||||
@echo "$(BOLD)Running makemigrations$(RESET)"
|
@echo "$(BOLD)Running makemigrations$(RESET)"
|
||||||
@$(COMPOSE) up -d postgresql
|
@$(COMPOSE) up -d postgresql
|
||||||
|
|||||||
@@ -137,3 +137,22 @@ python_files = [
|
|||||||
"test_*.py",
|
"test_*.py",
|
||||||
"tests.py",
|
"tests.py",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[tool.coverage.run]
|
||||||
|
branch = true
|
||||||
|
omit = [
|
||||||
|
"*/admin.py",
|
||||||
|
"*/migrations/*",
|
||||||
|
"*/tests/*",
|
||||||
|
"*/urls.py",
|
||||||
|
"manage.py",
|
||||||
|
"celery_app.py",
|
||||||
|
"wsgi.py",
|
||||||
|
]
|
||||||
|
|
||||||
|
[tool.coverage.report]
|
||||||
|
show_missing = true
|
||||||
|
skip_empty = true
|
||||||
|
|
||||||
|
[tool.coverage.json]
|
||||||
|
pretty_print = true
|
||||||
|
|||||||
Reference in New Issue
Block a user