From 10b12619d950d0783918ecca2dc2574fb44d2084 Mon Sep 17 00:00:00 2001 From: Iwan Aucamp Date: Tue, 19 Apr 2022 18:03:41 +0200 Subject: [PATCH] Tell coveragepy to ignore type checking code and `...` This is so we can get a more accurate picture of coverage. For more info see: - https://github.com/nedbat/coveragepy/issues/831 --- setup.cfg | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.cfg b/setup.cfg index 49fb301b9..fa434e078 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,6 +16,12 @@ exclude_lines = # Have to re-enable the standard pragma pragma: no cover + # TYPE_CHECKING guarded code only affects type checkers. + ^ +if (False|TYPE_CHECKING): + # constant used in protocols and abstract methods, does not run anything + # and has no side effects. + ^ +\.\.\.$ + # Don't complain if non-runnable code isn't run: if 0: if __name__ == .__main__.: