Skip to content

Commit

Permalink
Omit 'if TYPE_CHECKING' blocks from coverage
Browse files Browse the repository at this point in the history
These blocks only exist to create code which evaluates under mypy
but does not run at runtime. As a result, they are impossible to cover
with `coverage` on a testsuite, and make sense to exclude from
coverage reporting.
  • Loading branch information
sirosen committed Jan 5, 2022
1 parent cdc2807 commit 811bab2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
branch = True
source = jsonschema
omit = */jsonschema/_reflect.py,*/jsonschema/__main__.py,*/jsonschema/benchmarks/*,*/jsonschema/tests/fuzz_validate.py

[report]
exclude_lines =
if TYPE_CHECKING:

0 comments on commit 811bab2

Please sign in to comment.