Skip to content

Commit be5cffe

Browse files
committed
Adjust coverage exclusing & partial branch settings
1 parent 8a5128c commit be5cffe

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585

8686
- name: Show test results
8787
uses: mikepenz/action-junit-report@v5
88-
if: success() || failure() # always run even if the previous step fails
88+
if: always()
8989
with:
9090
report_paths: reports/junit/*.xml
9191

pyproject.toml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,23 @@ data_file = "reports/.coverage"
103103

104104
[tool.coverage.report]
105105
precision = 2
106-
exclude_lines = [
107-
"pragma: no cover",
106+
exclude_also = [
108107
"def __repr__",
109-
"if .*debug",
110108
"raise AssertionError",
111109
"raise NotImplementedError",
112-
"if __name__ == .__main__.:",
113-
"if TYPE_CHECKING:",
114-
"if logger.isEnabledFor",
115-
"if sys.version_info",
110+
"class .*\bProtocol:",
116111
"@(abc\\.)?abstractmethod",
117112
"\\.\\.\\.",
118113
"def downgrade\\(\\)",
119114
]
115+
partial_also = [
116+
"if .*TYPE_CHECKING:",
117+
"if .*isEnabledFor.*:",
118+
"if .*debug.*:",
119+
"if .*sys.version_info.*:",
120+
"if __name__ == .__main__.:",
121+
"except .*ImportError",
122+
]
120123

121124
[tool.ruff]
122125
target-version = "py37"

0 commit comments

Comments
 (0)