Skip to content

Commit f70b86d

Browse files
committed
Measure test coverage
1 parent a6a666d commit f70b86d

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

.coveragerc

Lines changed: 7 additions & 0 deletions
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/test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,10 @@ jobs:
3333
- name: Tox tests
3434
run: |
3535
uvx --with tox-uv tox -e py
36+
37+
- name: Upload coverage
38+
uses: codecov/[email protected]
39+
with:
40+
flags: ${{ matrix.os }}
41+
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
42+
token: ${{ secrets.CODECOV_ORG_TOKEN }}

README.md

Lines changed: 5 additions & 0 deletions
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

Lines changed: 12 additions & 1 deletion
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)