Skip to content

Commit ba06125

Browse files
akxhugovkradarhere
authored
Port coveragerc to pyproject.toml; omit benchmarks from coverage (#9771)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
1 parent 8a37d87 commit ba06125

2 files changed

Lines changed: 19 additions & 22 deletions

File tree

.coveragerc

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

pyproject.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,22 @@ addopts = [ "-ra", "--color=auto" ]
204204
testpaths = [
205205
"Tests",
206206
]
207+
208+
[tool.coverage]
209+
run.core = "sysmon" # default for 3.14+, available for 3.12+
210+
run.disable_warnings = [ "no-sysmon" ] # 3.11
211+
run.omit = [
212+
"checks/*.py",
213+
"Tests/benchmarks.py",
214+
"Tests/createfontdatachunk.py",
215+
]
216+
report.exclude_also = [
217+
"@abc.abstractmethod",
218+
# Empty bodies in protocols or abstract methods
219+
"^\\s*def [a-zA-Z0-9_]+\\(.*\\)(\\s*->.*)?:\\s*\\.\\.\\.(\\s*#.*)?$",
220+
# Don't complain about compatibility code for missing optional dependencies
221+
"except ImportError",
222+
"if __name__ == .__main__.:",
223+
# Don't complain about debug code
224+
"if DEBUG:",
225+
]

0 commit comments

Comments
 (0)