diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2018-08-09 21:15:24 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-08-12 07:13:31 -0400 |
commit | b355058f6cb4e3c9aa9c88f8e60af97872a969c6 (patch) | |
tree | 7a3dbe6f6ce7ed0ce4b97c0bcbae270d82999f68 /coverage/cmdline.py | |
parent | 975ebec2f81c4e5c992d65e6984c8ab122feffa6 (diff) | |
download | python-coveragepy-git-b355058f6cb4e3c9aa9c88f8e60af97872a969c6.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.
(cherry picked from commit 85725034b429fe46cf26429ce3bad0d53db82f3e)
Diffstat (limited to 'coverage/cmdline.py')
-rw-r--r-- | coverage/cmdline.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py index c21acda6..2b8e8fb9 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 |