Skip to content

Commit

Permalink
🔧 Update coverage configs (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Aug 18, 2024
1 parent 73f2129 commit d467ac7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
- run: ls -la coverage
- run: coverage combine coverage
- run: coverage report
- run: coverage html --show-contexts --title "Coverage for ${{ github.sha }}"
- run: coverage html --title "Coverage for ${{ github.sha }}"
- name: Store coverage HTML
uses: actions/upload-artifact@v4
with:
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,24 @@ source = [
"tests",
]
context = '${CONTEXT}'
dynamic_context = "test_function"
omit = [
"tests/assets/*",
]

[tool.coverage.report]
show_missing = true
sort = "-Cover"
exclude_lines = [
"pragma: no cover",
"@overload",
'if __name__ == "__main__":',
"if TYPE_CHECKING:",
]

[tool.coverage.html]
show_contexts = true

[tool.mypy]
strict = true
exclude = [
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-cov-html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ set -x

bash scripts/test.sh ${@}
coverage combine
coverage report --show-missing
coverage report
coverage html

0 comments on commit d467ac7

Please sign in to comment.