From 977dd43fe2ae4ec2dd3d17e606c5bf712deab26a Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Fri, 24 Nov 2023 01:58:36 -0800 Subject: [PATCH] Add code coverage exclude_lines config https://coverage.readthedocs.io/en/latest/config.html#sample-filehttps://coverage.readthedocs.io/en/latest/config.html#sample-file --- pyproject.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index e5598c2aff5..e50c9b1800d 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