Skip to content

Commit

Permalink
Ignore overload stubs in coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Apr 16, 2023
1 parent d432ce3 commit 48b2f78
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def coverage_report(session: nox.Session) -> None:
session.install("coverage[toml]")

session.run("coverage", "combine")
session.run("coverage", "report")
session.run("coverage", "report", "--fail-under=100")


@nox.session
Expand Down
18 changes: 18 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,24 @@ source = ["src", ".nox/tests*/**/site-packages"]
[tool.coverage.report]
show_missing = true
skip_covered = true
exclude_lines = [
# a more strict default pragma
"\\# pragma: no cover\\b",

# allow defensive code
"^\\s*raise AssertionError\\b",
"^\\s*raise NotImplementedError\\b",
"^\\s*return NotImplemented\\b",
"^\\s*raise$",

# typing-related code
"^if (False|TYPE_CHECKING):",
": \\.\\.\\.(\\s*#.*)?$",
"^ +\\.\\.\\.$",
"-> ['\"]?NoReturn['\"]?:",
]




[tool.black]
Expand Down

0 comments on commit 48b2f78

Please sign in to comment.