Skip to content

Commit 5515004

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

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
uses: actions/upload-artifact@v7
8585
with:
8686
name: coverage-data-${{ matrix.python-version }}-${{ steps.format_db_id.outputs.db_id }}
87-
path: '${{ github.workspace }}/.coverage.*'
87+
path: '${{ github.workspace }}/.coverage/*'
8888
include-hidden-files: true
8989
if-no-files-found: error
9090

@@ -108,7 +108,7 @@ jobs:
108108
- name: Download data
109109
uses: actions/download-artifact@v8
110110
with:
111-
path: ${{ github.workspace }}
111+
path: .coverage
112112
pattern: coverage-data-*
113113
merge-multiple: true
114114

pyproject.toml

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

141141
[tool.coverage]
142142
run.branch = true
143+
run.data_file = ".coverage/cov"
143144
run.parallel = true
144145
run.source = [
145146
"django_mysql",
@@ -150,6 +151,8 @@ paths.source = [
150151
".tox/**/site-packages",
151152
]
152153
report.show_missing = true
154+
report.skip_covered = true
155+
report.skip_empty = true
153156

154157
[tool.mypy]
155158
enable_error_code = [

0 commit comments

Comments
 (0)