Skip to content

Commit 972e3c5

Browse files
authored
Adds branch coverage (#88)
1 parent 75d918f commit 972e3c5

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

.github/workflows/_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ jobs:
156156
- name: Install packages
157157
run: uv pip install --system -e '.[test]'
158158
- name: Run tests
159-
run: pytest --cov django_squash --cov-report=term
159+
run: pytest --cov django_squash --cov-report=term --cov-context test
160160
- name: Upload coverage artifact
161161
uses: actions/upload-artifact@v4
162162
with:

pyproject.toml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,19 @@ section-order = [
175175
max-complexity = 10
176176

177177
[tool.coverage.run]
178+
branch = true
179+
relative_files = true
180+
parallel = true
178181
source = ["django_squash"]
182+
omit = ["*/migrations_*/*", "./tests/*"]
179183

180184
[tool.coverage.report]
181-
omit = ["*/migrations_*/*"]
182185
show_missing = true
183-
fail_under = 95
186+
fail_under = 90
187+
188+
[tool.coverage.html]
189+
show_contexts = true
190+
skip_covered = false
184191

185192
[tool.pypi]
186193
repository = "https://upload.pypi.org/legacy/"
@@ -204,7 +211,8 @@ markers = [
204211
"temporary_migration_module",
205212
"temporary_migration_module2",
206213
"temporary_migration_module3",
207-
"slow: marks tests as slow"
214+
"slow: marks tests as slow",
215+
"no_cover: marks tests to be excluded from coverage"
208216
]
209217

210218
filterwarnings = [

tests/test_standalone.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def download_and_extract_tar(url):
8585

8686

8787
@pytest.mark.slow
88+
@pytest.mark.no_cover
8889
def test_standalone_app():
8990
"""Test that a standalone (django sample poll) app can be installed using venv.
9091

0 commit comments

Comments
 (0)