coverage: use pyproject.toml

This commit is contained in:
Thomas Waldmann 2025-07-06 15:59:56 +02:00
parent 16feb6d42c
commit 75e5db0857
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01
4 changed files with 30 additions and 25 deletions

View file

@ -1,24 +0,0 @@
[run]
branch = True
disable_warnings = module-not-measured
source = src/borg
omit =
*/borg/__init__.py
*/borg/__main__.py
*/borg/_version.py
*/borg/fuse.py
*/borg/support/*
*/borg/testsuite/*
*/borg/hash_sizes.py
[report]
exclude_lines =
pragma: no cover
pragma: freebsd only
pragma: unknown platform only
def __repr__
raise AssertionError
raise NotImplementedError
if 0:
if __name__ == .__main__.:
ignore_errors = True

View file

@ -180,7 +180,7 @@ description = "Run tests with pytest"
package = "editable-legacy" # without this it does not find setup_docs when running under fakeroot
deps = ["-rrequirements.d/development.txt"]
commands = [
["pytest", "-v", "-n", "{env:XDISTN:1}", "-rs", "--cov=borg", "--cov-config=.coveragerc", "--benchmark-skip", "--pyargs", "{posargs:borg.testsuite}"]
["pytest", "-v", "-n", "{env:XDISTN:1}", "-rs", "--cov=borg", "--cov-config=pyproject.toml", "--benchmark-skip", "--pyargs", "{posargs:borg.testsuite}"]
]
pass_env = ["*"] # fakeroot -u needs some env vars
labels = ["test"]
@ -215,3 +215,30 @@ commands = [
["ruff", "check", "."]
]
labels = ["lint"]
[tool.coverage.run]
branch = true
disable_warnings = ["module-not-measured"]
source = ["src/borg"]
omit = [
"*/borg/__init__.py",
"*/borg/__main__.py",
"*/borg/_version.py",
"*/borg/fuse.py",
"*/borg/support/*",
"*/borg/testsuite/*",
"*/borg/hash_sizes.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"pragma: freebsd only",
"pragma: unknown platform only",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
]
ignore_errors = true

View file

@ -7,6 +7,7 @@ pkgconfig==1.5.5
tox==4.24.2
pytest==8.3.5
pytest-xdist==3.6.1
coverage[toml]==7.9.1
pytest-cov==6.0.0
pytest-benchmark==5.1.0
Cython==3.0.12

View file

@ -7,6 +7,7 @@ pkgconfig
tox
pytest
pytest-xdist
coverage[toml]
pytest-cov
pytest-benchmark
Cython