File tree 3 files changed +11
-28
lines changed
3 files changed +11
-28
lines changed Original file line number Diff line number Diff line change @@ -54,10 +54,16 @@ python3 runtests.py
54
54
You can also use ` tox ` to run tests (` tox ` handles setting up the test environment for you):
55
55
```
56
56
tox -e py
57
+
58
+ # Or some specific python version:
59
+ tox -e py39
60
+
61
+ # Or some specific command:
62
+ tox -e lint
57
63
```
58
64
59
65
Some useful commands for running specific tests include:
60
- ```
66
+ ``` bash
61
67
# Use mypy to check mypy's own code
62
68
python3 runtests.py self
63
69
# or equivalently:
Original file line number Diff line number Diff line change @@ -176,6 +176,10 @@ full builtins and library stubs instead of minimal ones. Run them using
176
176
Note that running more processes than logical cores is likely to
177
177
significantly decrease performance.
178
178
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
+
179
183
180
184
Debugging
181
185
---------
Original file line number Diff line number Diff line change @@ -14,36 +14,9 @@ isolated_build = true
14
14
15
15
[testenv]
16
16
description = run the test driver with {basepython}
17
- setenv = cov: COVERAGE_FILE ={toxworkdir}/.coverage.{envname}
18
17
passenv = PYTEST_XDIST_WORKER_COUNT PROGRAMDATA PROGRAMFILES(X86)
19
18
deps = -rtest-requirements.txt
20
19
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
47
20
48
21
[testenv:lint]
49
22
description = check the code style
You can’t perform that action at this time.
0 commit comments