diff options
author | Ned Batchelder <nedbat@gmail.com> | 2015-04-24 20:17:09 -0400 |
---|---|---|
committer | Ned Batchelder <nedbat@gmail.com> | 2015-04-24 20:17:09 -0400 |
commit | f178835e323d5abbfb0f249326bbde24cecb15b7 (patch) | |
tree | 59f6c1ca04077b35bb9ceabdeff9e63297a537d5 /coverage/control.py | |
parent | b61d05fa1f80f375d49aefe59a4c46d083f0fe08 (diff) | |
parent | e114efc35ad2c2134f7d4c24a7a4fac286f9e50a (diff) | |
download | python-coveragepy-f178835e323d5abbfb0f249326bbde24cecb15b7.tar.gz |
Merged in clytwynec/coverage.py/combine-from-multiple-dirs (pull request #51)
Added ability to combine coverage data files from multiple directories into one file via command line args.
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/coverage/control.py b/coverage/control.py index 563925e..2c8d384 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -717,13 +717,17 @@ class Coverage(object): self._harvest_data() self.data.write(suffix=data_suffix) - def combine(self): + def combine(self, data_dirs=None): """Combine together a number of similarly-named coverage data files. All coverage data files whose name starts with `data_file` (from the coverage() constructor) will be read, and combined together into the current measurements. + `data_dirs` is a list of directories from which data files should be + combined. If no list is passed, then the data files from the current + directory will be combined. + """ self._init() aliases = None @@ -733,7 +737,7 @@ class Coverage(object): result = paths[0] for pattern in paths[1:]: aliases.add(pattern, result) - self.data.combine_parallel_data(aliases=aliases) + self.data.combine_parallel_data(aliases=aliases, data_dirs=data_dirs) def _harvest_data(self): """Get the collected data and reset the collector. |