From 1eb5c779de082610d7cf2abb14d04b17b14da9e9 Mon Sep 17 00:00:00 2001 From: Pierre Chapuis Date: Mon, 29 Jan 2024 18:35:02 +0100 Subject: [PATCH] better coverage config - exclude e.g. tests - include files not imported at all - exclude some common patterns (see https://coverage.readthedocs.io/en/7.4.1/excluding.html#excluding-source-files) --- pyproject.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index ae480f71d..22c4214e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -107,7 +107,15 @@ reportMissingTypeStubs = "warning" [tool.coverage.run] branch = true +source = ["src/refiners"] # Also apply to HTML output, where appropriate [tool.coverage.report] ignore_errors = true # see `build-html-cov` for details +exclude_also = [ + "def __repr__", + "raise NotImplementedError", + "if TYPE_CHECKING:", + "class .*\\bProtocol\\):", + "@(abc\\.)?abstractmethod", +]