Skip to content

Commit 0e3286d

Browse files
committed
coverage: add coverage config and package
1 parent 6f2cd0c commit 0e3286d

File tree

2 files changed

+131
-0
lines changed

2 files changed

+131
-0
lines changed

pyproject.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ dev = [
6060
"pytest-pretty>=1.2.0",
6161
"inline-snapshot>=0.23.0",
6262
"dirty-equals>=0.9.0",
63+
"coverage[toml]==7.10.7",
6364
]
6465
docs = [
6566
"mkdocs>=1.6.1",
@@ -168,3 +169,27 @@ MD033 = false # no-inline-html Inline HTML
168169
MD041 = false # first-line-heading/first-line-h1
169170
MD046 = false # indented-code-blocks
170171
MD059 = false # descriptive-link-text
172+
173+
# https://coverage.readthedocs.io/en/latest/config.html#run
174+
[tool.coverage.run]
175+
branch = true
176+
patch = ["subprocess"]
177+
concurrency = ["multiprocessing", "thread"]
178+
source = ["src", "tests"]
179+
180+
# https://coverage.readthedocs.io/en/latest/config.html#report
181+
[tool.coverage.report]
182+
fail_under = 100
183+
skip_covered = true
184+
show_missing = true
185+
ignore_errors = true
186+
precision = 2
187+
exclude_lines = [
188+
"pragma: no cover",
189+
"if TYPE_CHECKING:",
190+
"@overload",
191+
"raise NotImplementedError",
192+
]
193+
exclude_also = [
194+
'\A(?s:.*# pragma: exclude file.*)\Z'
195+
]

0 commit comments

Comments
 (0)