summaryrefslogtreecommitdiff
path: root/coverage/cmdline.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-08-09 21:15:24 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-08-09 21:15:24 -0400
commit85725034b429fe46cf26429ce3bad0d53db82f3e (patch)
tree8c13011e1a4bd0c5c53dfdeaef0ba03fc4a06c7c /coverage/cmdline.py
parent44beff7f1ce7b8320943abc61a7c70410ab8dbdf (diff)
downloadpython-coveragepy-git-85725034b429fe46cf26429ce3bad0d53db82f3e.tar.gz
Simplify how run --append works.
I don't know why it was using combine after, when .load before seems like the obvious way to do it.
Diffstat (limited to 'coverage/cmdline.py')
-rw-r--r--coverage/cmdline.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index 1b7955d3..14948d1c 100644
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -392,7 +392,7 @@ class CoverageScript(object):
def __init__(
self, _covpkg=None, _run_python_file=None,
- _run_python_module=None, _help_fn=None, _path_exists=None,
+ _run_python_module=None, _help_fn=None,
):
# _covpkg is for dependency injection, so we can test this code.
if _covpkg:
@@ -405,7 +405,6 @@ class CoverageScript(object):
self.run_python_file = _run_python_file or run_python_file
self.run_python_module = _run_python_module or run_python_module
self.help_fn = _help_fn or self.help
- self.path_exists = _path_exists or os.path.exists
self.global_option = False
self.coverage = None
@@ -619,6 +618,9 @@ class CoverageScript(object):
)
return ERR
+ if options.append:
+ self.coverage.load()
+
# Run the script.
self.coverage.start()
code_ran = True
@@ -634,10 +636,6 @@ class CoverageScript(object):
finally:
self.coverage.stop()
if code_ran:
- if options.append:
- data_file = self.coverage.get_option("run:data_file")
- if self.path_exists(data_file):
- self.coverage.combine(data_paths=[data_file])
self.coverage.save()
return OK