Skip to content

Commit afd2032

Browse files
committed
Move coverage configuration to pyproject.toml
1 parent c539e8f commit afd2032

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

.coveragerc

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ but please don't include them in your pull requests.
163163

164164
After this short initial setup you're ready to run tests::
165165

166-
$ COVERAGE_PROCESS_START=`pwd`/.coveragerc COVERAGE_FILE=`pwd`/.coverage PYTHONPATH=`pwd` pytest --ds=pytest_django_test.settings_postgres
166+
$ COVERAGE_PROCESS_START=`pwd`/pyproject.toml COVERAGE_FILE=`pwd`/.coverage PYTHONPATH=`pwd` pytest --ds=pytest_django_test.settings_postgres
167167

168168
You should repeat the above step for sqlite and mysql before the next step.
169169
This step will create a lot of ``.coverage`` files with additional suffixes for

pyproject.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,19 @@ module = [
3636
"psycopg2cffi.*",
3737
]
3838
ignore_missing_imports = true
39+
40+
[tool.coverage.run]
41+
parallel = true
42+
source = ["${PYTESTDJANGO_COVERAGE_SRC}."]
43+
branch = true
44+
[tool.coverage.report]
45+
include = [
46+
"pytest_django/*",
47+
"pytest_django_test/*",
48+
"tests/*",
49+
]
50+
skip_covered = true
51+
exclude_lines = [
52+
"pragma: no cover",
53+
"if TYPE_CHECKING:",
54+
]

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ deps =
2020

2121
!pypy3-postgres: psycopg2-binary
2222
pypy3-postgres: psycopg2cffi
23+
coverage: coverage[toml]
2324
coverage: coverage-enable-subprocess
2425

2526
pytestmin: pytest>=7.0,<7.1
@@ -35,7 +36,7 @@ setenv =
3536
sqlite_file: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite_file
3637

3738
coverage: PYTESTDJANGO_TEST_RUNNER=coverage run -m pytest
38-
coverage: COVERAGE_PROCESS_START={toxinidir}/.coveragerc
39+
coverage: COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
3940
coverage: COVERAGE_FILE={toxinidir}/.coverage
4041
coverage: PYTESTDJANGO_COVERAGE_SRC={toxinidir}/
4142

0 commit comments

Comments
 (0)