From 9dc224723b8c8008ea994474b2c42ded5cda38d6 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Fri, 14 Jun 2024 11:56:35 +0200 Subject: [PATCH] Tell coverage tool to ignore lines intended for mypy only In particular, `if TYPE_CHECKING:` blocks and `...` in bodies of overloaded method definitions. --- .coveragerc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.coveragerc b/.coveragerc index 8708371a..77531508 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,2 +1,8 @@ [run] include = model_utils/*.py + +[report] +exclude_also = + # Exclusive to mypy: + if TYPE_CHECKING:$ + \.\.\.$