|
1 | 1 | """Coverage plugin for pytest.""" |
| 2 | +import argparse |
2 | 3 | import os |
3 | 4 | import warnings |
4 | 5 |
|
5 | 6 | import pytest |
6 | | -import argparse |
7 | | - |
8 | 7 | from coverage.misc import CoverageException |
9 | 8 |
|
| 9 | +from . import compat |
10 | 10 | from . import embed |
11 | 11 | from . import engine |
12 | | -from . import compat |
13 | 12 |
|
14 | 13 |
|
15 | 14 | class CoverageError(Exception): |
@@ -53,20 +52,20 @@ def pytest_addoption(parser): |
53 | 52 |
|
54 | 53 | group = parser.getgroup( |
55 | 54 | 'cov', 'coverage reporting with distributed testing support') |
56 | | - group.addoption('--cov', action='append', default=[], metavar='path', |
| 55 | + group.addoption('--cov', action='append', default=[], metavar='SOURCE', |
57 | 56 | nargs='?', const=True, dest='cov_source', |
58 | | - help='Measure coverage for filesystem path. ' |
59 | | - '(multi-allowed)') |
| 57 | + help='Path or package name to measure during execution (multi-allowed). ' |
| 58 | + 'Use --cov= to not do any source filtering and record everything.') |
60 | 59 | group.addoption('--cov-report', action=StoreReport, default={}, |
61 | | - metavar='type', type=validate_report, |
| 60 | + metavar='TYPE', type=validate_report, |
62 | 61 | help='Type of report to generate: term, term-missing, ' |
63 | | - 'annotate, html, xml (multi-allowed). ' |
64 | | - 'term, term-missing may be followed by ":skip-covered". ' |
65 | | - 'annotate, html and xml may be followed by ":DEST" ' |
66 | | - 'where DEST specifies the output location. ' |
67 | | - 'Use --cov-report= to not generate any output.') |
| 62 | + 'annotate, html, xml (multi-allowed). ' |
| 63 | + 'term, term-missing may be followed by ":skip-covered". ' |
| 64 | + 'annotate, html and xml may be followed by ":DEST" ' |
| 65 | + 'where DEST specifies the output location. ' |
| 66 | + 'Use --cov-report= to not generate any output.') |
68 | 67 | group.addoption('--cov-config', action='store', default='.coveragerc', |
69 | | - metavar='path', |
| 68 | + metavar='PATH', |
70 | 69 | help='Config file for coverage. Default: .coveragerc') |
71 | 70 | group.addoption('--no-cov-on-fail', action='store_true', default=False, |
72 | 71 | help='Do not report coverage if test run fails. ' |
|
0 commit comments