summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorloic <loic@dachary.org>2017-01-07 14:39:44 +0100
committerloic <loic@dachary.org>2017-01-07 14:39:44 +0100
commitc80eedd40b8650066928a94c7ae3680b38a10e67 (patch)
tree8604448885a2ec9c06f53509e75224e4a157b41e /coverage/control.py
parentf5587814d1aa983ad995b2c1acc391f6251ceda0 (diff)
downloadpython-coveragepy-c80eedd40b8650066928a94c7ae3680b38a10e67.tar.gz
* --source and --include are mutually exclusive (take 2) #265
close #265 close #101
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/coverage/control.py b/coverage/control.py
index 2cbe491..c2fe806 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -143,7 +143,8 @@ class Coverage(object):
config_file=config_file,
data_file=data_file, cover_pylib=cover_pylib, timid=timid,
branch=branch, parallel=bool_or_none(data_suffix),
- source=source, omit=omit, include=include, debug=debug,
+ source=source, run_omit=omit, run_include=include, debug=debug,
+ report_omit=omit, report_include=include,
concurrency=concurrency,
)
@@ -235,8 +236,8 @@ class Coverage(object):
self.source_pkgs.append(src)
self.source_pkgs_unmatched = self.source_pkgs[:]
- self.omit = prep_patterns(self.config.omit)
- self.include = prep_patterns(self.config.include)
+ self.omit = prep_patterns(self.config.run_omit)
+ self.include = prep_patterns(self.config.run_include)
concurrency = self.config.concurrency or []
if "multiprocessing" in concurrency:
@@ -346,6 +347,8 @@ class Coverage(object):
if self.pylib_paths:
self.pylib_match = TreeMatcher(self.pylib_paths)
if self.include:
+ if self.source or self.source_pkgs:
+ print("--include is ignored because --source is set")
self.include_match = FnmatchMatcher(self.include)
if self.omit:
self.omit_match = FnmatchMatcher(self.omit)
@@ -1029,7 +1032,7 @@ class Coverage(object):
"""
self.get_data()
self.config.from_args(
- ignore_errors=ignore_errors, omit=omit, include=include,
+ ignore_errors=ignore_errors, report_omit=omit, report_include=include,
show_missing=show_missing, skip_covered=skip_covered,
)
reporter = SummaryReporter(self, self.config)
@@ -1051,7 +1054,7 @@ class Coverage(object):
"""
self.get_data()
self.config.from_args(
- ignore_errors=ignore_errors, omit=omit, include=include
+ ignore_errors=ignore_errors, report_omit=omit, report_include=include
)
reporter = AnnotateReporter(self, self.config)
reporter.report(morfs, directory=directory)
@@ -1078,7 +1081,7 @@ class Coverage(object):
"""
self.get_data()
self.config.from_args(
- ignore_errors=ignore_errors, omit=omit, include=include,
+ ignore_errors=ignore_errors, report_omit=omit, report_include=include,
html_dir=directory, extra_css=extra_css, html_title=title,
skip_covered=skip_covered,
)
@@ -1103,7 +1106,7 @@ class Coverage(object):
"""
self.get_data()
self.config.from_args(
- ignore_errors=ignore_errors, omit=omit, include=include,
+ ignore_errors=ignore_errors, report_omit=omit, report_include=include,
xml_output=outfile,
)
file_to_close = None