Skip to content

Commit 978b8ec

Browse files
committed
Measure test coverage
1 parent 3eb7be3 commit 978b8ec

File tree

5 files changed

+35
-1
lines changed

5 files changed

+35
-1
lines changed

.coveragerc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# .coveragerc to control coverage.py
2+
3+
[report]
4+
# Regexes for lines to exclude from consideration
5+
exclude_also =
6+
# Don't complain if non-runnable code isn't run:
7+
if __name__ == .__main__.:

.github/workflows/lint.yml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v4
18+
with:
19+
persist-credentials: false
1820
- uses: actions/setup-python@v5
1921
with:
2022
python-version: "3.x"

.github/workflows/test.yml

+9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v4
22+
with:
23+
persist-credentials: false
2224

2325
- name: Set up Python ${{ matrix.python-version }}
2426
uses: actions/setup-python@v5
@@ -32,3 +34,10 @@ jobs:
3234
- name: Tox tests
3335
run: |
3436
uvx --with tox-uv tox -e py
37+
38+
- name: Upload coverage
39+
uses: codecov/[email protected]
40+
with:
41+
flags: ${{ matrix.os }}
42+
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
43+
token: ${{ secrets.CODECOV_ORG_TOKEN }}

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# docsbuild-scripts
2+
3+
[![GitHub Actions status](https://github.com/python/docsbuild-scripts/actions/workflows/test.yml/badge.svg)](https://github.com/python/docsbuild-scripts/actions/workflows/test.yml)
4+
[![Codecov](https://codecov.io/gh/python/docsbuild-scripts/branch/main/graph/badge.svg)](https://codecov.io/gh/python/docsbuild-scripts)
5+
16
This repository contains scripts for automatically building the Python
27
documentation on [docs.python.org](https://docs.python.org).
38

tox.ini

+12-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,19 @@ skip_install = true
1212
deps =
1313
-r requirements.txt
1414
pytest
15+
pytest-cov
16+
pass_env =
17+
FORCE_COLOR
18+
set_env =
19+
COVERAGE_CORE = sysmon
1520
commands =
16-
{envpython} -m pytest {posargs}
21+
{envpython} -m pytest \
22+
--cov . \
23+
--cov tests \
24+
--cov-report html \
25+
--cov-report term \
26+
--cov-report xml \
27+
{posargs}
1728

1829
[testenv:lint]
1930
skip_install = true

0 commit comments

Comments
 (0)