Skip to content

Commit 8073a60

Browse files
committed
Tests: Use pytest-cov, and configure in pyproject.toml
1 parent aec55b1 commit 8073a60

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

.coveragerc

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

.github/workflows/tests.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ jobs:
7474
poe lint
7575
7676
# Run tests.
77-
uv run coverage run -m pytest
78-
79-
# Set the stage for uploading the coverage report.
80-
uv run coverage xml
77+
poe test
8178
8279
# https://github.com/codecov/codecov-action
8380
- name: Upload coverage results to Codecov

pyproject.toml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,40 @@ dependencies = [
4141
[dependency-groups]
4242
dev = [
4343
"certifi>=2025.10.5",
44-
"coverage>=7.11.0",
4544
"mypy>=1.18.2",
4645
"poethepoet<1",
4746
"pytest>=8.4.2",
47+
"pytest-cov<8",
4848
"pytz>=2025.2",
4949
"ruff>=0.14.2",
5050
"setuptools>=80.9.0",
5151
"stopit>=1.1.2",
5252
]
5353

5454

55+
[tool.coverage.run]
56+
branch = false
57+
omit = [
58+
"tests/*",
59+
]
60+
source = [ "src" ]
61+
62+
[tool.coverage.report]
63+
fail_under = 0
64+
show_missing = true
65+
exclude_lines = [
66+
"# pragma: no cover",
67+
"raise NotImplemented",
68+
]
69+
omit = [
70+
"*/.buildout/eggs/*",
71+
"buildout-cache/eggs/*",
72+
"eggs/*",
73+
"parts/*",
74+
"src/crate/client/_pep440.py",
75+
]
76+
77+
5578
[tool.mypy]
5679
mypy_path = "src"
5780
packages = [
@@ -69,7 +92,7 @@ non_interactive = true
6992

7093

7194
[tool.pytest.ini_options]
72-
addopts = "-rA --verbosity=3"
95+
addopts = "-rA --verbosity=3 --cov --cov-report=term-missing --cov-report=xml"
7396
minversion = "2.0"
7497
log_level = "DEBUG"
7598
log_cli_level = "DEBUG"

0 commit comments

Comments
 (0)