Skip to content

Commit adbb523

Browse files
committed
Tests: Use pytest-cov, and configure in pyproject.toml
1 parent 57673f9 commit adbb523

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
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: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,29 @@ dev = [
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)