Skip to content

Commit 97e73ea

Browse files
committed
chore: update pytest configuration in pyproject.toml and GitHub Actions workflow for improved coverage reporting
1 parent cdc435f commit 97e73ea

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,18 @@ jobs:
4444
run: uv sync --locked
4545

4646
- name: Run unit tests
47-
run: uv run pytest -m "not integration" -v --cov-append
47+
run: uv run pytest -m "not integration" -v --cov=src --cov-append --cov-report=term-missing
4848
env:
4949
MODELSCOPE_API_TOKEN: ${{ secrets.MODELSCOPE_API_TOKEN }}
5050

5151
- name: Run integration tests (fast)
52-
run: uv run pytest -m "integration and not slow" -v --cov-append
52+
run: uv run pytest -m "integration and not slow" -v --cov=src --cov-append --cov-report=term-missing
5353
env:
5454
MODELSCOPE_API_TOKEN: ${{ secrets.MODELSCOPE_API_TOKEN }}
5555

5656
- name: Run integration tests (slow)
57-
run: uv run pytest -m "integration and slow" -v -s --cov-append
57+
run: uv run pytest -m "integration and slow" -v -s --cov=src --cov-append --cov-report=term-missing
58+
if: matrix.python-version == '3.12' # Only run once to reduce costs
5859
env:
5960
MODELSCOPE_API_TOKEN: ${{ secrets.MODELSCOPE_API_TOKEN }}
6061

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ dev = [
6161
[tool.pytest.ini_options]
6262
asyncio_mode = "auto"
6363
testpaths = ["tests"]
64-
addopts = ["-m", "not slow", "--cov=src", "--cov-report="]
64+
addopts = ["-m", "not slow"]
6565
env = [
6666
"MODELSCOPE_LOG_LEVEL=INFO",
6767
]

0 commit comments

Comments
 (0)