diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 1f474015e30..00000000000 --- a/.coveragerc +++ /dev/null @@ -1,22 +0,0 @@ -# .coveragerc to control coverage.py - -[report] -# Regexes for lines to exclude from consideration -exclude_also = - # Don't complain if non-runnable code isn't run - if 0: - if __name__ == .__main__.: - # Don't complain about debug code - if DEBUG: - # Don't complain about compatibility code for missing optional dependencies - except ImportError - if TYPE_CHECKING: - @abc.abstractmethod - # Empty bodies in protocols or abstract methods - ^\s*def [a-zA-Z0-9_]+\(.*\)(\s*->.*)?:\s*\.\.\.(\s*#.*)?$ - ^\s*\.\.\.(\s*#.*)?$ - -[run] -omit = - checks/*.py - Tests/createfontdatachunk.py diff --git a/pyproject.toml b/pyproject.toml index a2366e717ff..970dbdef6de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -204,3 +204,22 @@ addopts = [ "-ra", "--color=auto" ] testpaths = [ "Tests", ] + +[tool.coverage] +run.core = "sysmon" # default for 3.14+, available for 3.12+ +run.disable_warnings = [ "no-sysmon" ] # 3.11 +run.omit = [ + "checks/*.py", + "Tests/benchmarks.py", + "Tests/createfontdatachunk.py", +] +report.exclude_also = [ + "@abc.abstractmethod", + # Empty bodies in protocols or abstract methods + "^\\s*def [a-zA-Z0-9_]+\\(.*\\)(\\s*->.*)?:\\s*\\.\\.\\.(\\s*#.*)?$", + # Don't complain about compatibility code for missing optional dependencies + "except ImportError", + "if __name__ == .__main__.:", + # Don't complain about debug code + "if DEBUG:", +]