From 87c2974db92634636b8f7b4770acef3068861148 Mon Sep 17 00:00:00 2001 From: Marcos Prieto Date: Thu, 16 May 2024 11:06:29 +0200 Subject: [PATCH] Exclude TYPE_CHECKING blocks from coverage This might become the default in the future, see: - https://github.com/nedbat/coveragepy/issues/831 --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 423e485f01..bc718d1299 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,10 @@ show_missing = true precision = 2 fail_under = 100.00 skip_covered = true +exclude_also = [ + # # TYPE_CHECKING block is only executed while running mypy + "if TYPE_CHECKING:" +] [tool.pylint.main] jobs = 0 # Use one process for CPU.