From e416a839d9fc5da2e3d537c49d4ba655eaf01499 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Mon, 27 Nov 2023 10:56:47 -0800 Subject: [PATCH] Add code coverage exclude_lines config (#1995) https://coverage.readthedocs.io/en/latest/config.html#sample-filehttps://coverage.readthedocs.io/en/latest/config.html#sample-file Signed-off-by: Matthew Hoffman Signed-off-by: Rafael Raposo --- pyproject.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index e5598c2aff..e50c9b1800 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,6 +7,17 @@ markers = [ "sandbox_test: fake integration tests", ] +[tool.coverage.report] +exclude_also = [ + "def __repr__", + "pragma: no cover", + "if __name__ == .__main__.:", + "if (typing\\.)?TYPE_CHECKING:", + "@(typing\\.)?overload", + "@(abc\\.)?abstractmethod", + "raise NotImplementedError", +] + [tool.coverage.run] branch = true