Skip to content

Commit a2dee8a

Browse files
authored
Improve Coverage.py configuration (#712)
Hide data files within a directory to avoid cluttering the repository root, and minimize reports.
1 parent fed4766 commit a2dee8a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
uses: actions/upload-artifact@v7
4747
with:
4848
name: coverage-data-${{ matrix.python-version }}
49-
path: '${{ github.workspace }}/.coverage.*'
49+
path: '${{ github.workspace }}/.coverage/*'
5050
include-hidden-files: true
5151
if-no-files-found: error
5252

@@ -70,7 +70,7 @@ jobs:
7070
- name: Download data
7171
uses: actions/download-artifact@v8
7272
with:
73-
path: ${{ github.workspace }}
73+
path: .coverage
7474
pattern: coverage-data-*
7575
merge-multiple: true
7676

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ ini_options.xfail_strict = true
103103

104104
[tool.coverage]
105105
run.branch = true
106+
run.data_file = ".coverage/cov"
106107
run.parallel = true
107108
run.source = [
108109
"pytest_randomly",
@@ -113,6 +114,8 @@ paths.source = [
113114
".tox/**/site-packages",
114115
]
115116
report.show_missing = true
117+
report.skip_covered = true
118+
report.skip_empty = true
116119

117120
[tool.mypy]
118121
enable_error_code = [

0 commit comments

Comments
 (0)