Skip to content

Commit cad2e12

Browse files
committed
Sort imports and improve docstrings, esp. on --cov. Ref #282.
1 parent 4082617 commit cad2e12

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/pytest_cov/plugin.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
"""Coverage plugin for pytest."""
2+
import argparse
23
import os
34
import warnings
45

56
import pytest
6-
import argparse
7-
87
from coverage.misc import CoverageException
98

9+
from . import compat
1010
from . import embed
1111
from . import engine
12-
from . import compat
1312

1413

1514
class CoverageError(Exception):
@@ -53,20 +52,20 @@ def pytest_addoption(parser):
5352

5453
group = parser.getgroup(
5554
'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',
5756
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.')
6059
group.addoption('--cov-report', action=StoreReport, default={},
61-
metavar='type', type=validate_report,
60+
metavar='TYPE', type=validate_report,
6261
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.')
6867
group.addoption('--cov-config', action='store', default='.coveragerc',
69-
metavar='path',
68+
metavar='PATH',
7069
help='Config file for coverage. Default: .coveragerc')
7170
group.addoption('--no-cov-on-fail', action='store_true', default=False,
7271
help='Do not report coverage if test run fails. '

0 commit comments

Comments
 (0)