Skip to content

Commit ee9dfbc

Browse files
committed
Rename the internal var for --cov-append to cov_append and add specific option for it in the controller class.
1 parent c1975d5 commit ee9dfbc

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/pytest_cov/engine.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
class CovController(object):
1616
"""Base class for different plugin implementations."""
1717

18-
def __init__(self, cov_source, cov_report, cov_config, config=None, nodeid=None):
18+
def __init__(self, cov_source, cov_report, cov_config, cov_append, config=None, nodeid=None):
1919
"""Get some common config used by multiple derived classes."""
2020
self.cov_source = cov_source
2121
self.cov_report = cov_report
2222
self.cov_config = cov_config
23+
self.cov_append = cov_append
2324
self.config = config
2425
self.nodeid = nodeid
2526

@@ -115,7 +116,7 @@ def start(self):
115116

116117
self.cov = coverage.coverage(source=self.cov_source,
117118
config_file=self.cov_config)
118-
if self.config.option.append_coverage:
119+
if self.cov_append:
119120
self.cov.load()
120121
else:
121122
self.cov.erase()

src/pytest_cov/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def pytest_addoption(parser):
3636
group.addoption('--cov-fail-under', action='store', metavar='MIN', type='int',
3737
help='Fail if the total coverage is less than MIN.')
3838
group.addoption('--cov-append', action='store_true', default=False,
39-
dest='append_coverage',
4039
help='do not delete coverage but append to current, '
4140
'default: False')
4241

@@ -117,6 +116,7 @@ class Config(object):
117116
self.options.cov_source,
118117
self.options.cov_report,
119118
self.options.cov_config,
119+
self.options.cov_append,
120120
config,
121121
nodeid
122122
)

0 commit comments

Comments
 (0)