Skip to content

Commit 49983fc

Browse files
authored
tox: remove outdate coverage targets (#13520)
1 parent da56c97 commit 49983fc

File tree

3 files changed

+11
-28
lines changed

3 files changed

+11
-28
lines changed

CONTRIBUTING.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,16 @@ python3 runtests.py
5454
You can also use `tox` to run tests (`tox` handles setting up the test environment for you):
5555
```
5656
tox -e py
57+
58+
# Or some specific python version:
59+
tox -e py39
60+
61+
# Or some specific command:
62+
tox -e lint
5763
```
5864

5965
Some useful commands for running specific tests include:
60-
```
66+
```bash
6167
# Use mypy to check mypy's own code
6268
python3 runtests.py self
6369
# or equivalently:

test-data/unit/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ full builtins and library stubs instead of minimal ones. Run them using
176176
Note that running more processes than logical cores is likely to
177177
significantly decrease performance.
178178

179+
To run tests with coverage:
180+
181+
python3 -m pytest --durations 100 --cov mypy --cov-config setup.cfg --cov-report=term-missing:skip-covered --cov-report=html
182+
179183

180184
Debugging
181185
---------

tox.ini

-27
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,9 @@ isolated_build = true
1414

1515
[testenv]
1616
description = run the test driver with {basepython}
17-
setenv = cov: COVERAGE_FILE={toxworkdir}/.coverage.{envname}
1817
passenv = PYTEST_XDIST_WORKER_COUNT PROGRAMDATA PROGRAMFILES(X86)
1918
deps = -rtest-requirements.txt
2019
commands = python -m pytest --durations 100 {posargs}
21-
cov: python -m pytest --durations 100 {posargs: --cov mypy --cov-config setup.cfg}
22-
23-
24-
[testenv:coverage]
25-
description = [run locally after tests]: combine coverage data and create report
26-
deps =
27-
coverage >= 4.5.1, < 5
28-
diff_cover >= 1.0.5, <2
29-
skip_install = True
30-
passenv =
31-
{[testenv]passenv}
32-
DIFF_AGAINST
33-
setenv = COVERAGE_FILE={toxworkdir}/.coverage
34-
commands =
35-
coverage combine --rcfile setup.cfg
36-
coverage report -m --rcfile setup.cfg
37-
coverage xml -o {toxworkdir}/coverage.xml --rcfile setup.cfg
38-
coverage html -d {toxworkdir}/htmlcov --rcfile setup.cfg
39-
diff-cover --compare-branch {env:DIFF_AGAINST:origin/master} {toxworkdir}/coverage.xml
40-
depends =
41-
py36,
42-
py37,
43-
py38,
44-
py39,
45-
py310,
46-
parallel_show_output = True
4720

4821
[testenv:lint]
4922
description = check the code style

0 commit comments

Comments
 (0)