diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2010-01-03 10:23:06 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2010-01-03 10:23:06 -0500 |
commit | a5bc551f78df166a0d0e272fae7a7b5205b416f7 (patch) | |
tree | 652c49d9cf3c401b0e8263764d24d7456f634f89 /coverage/data.py | |
parent | 47c3f02dab1a745f595008d006f1474f148a9157 (diff) | |
download | python-coveragepy-a5bc551f78df166a0d0e272fae7a7b5205b416f7.tar.gz |
Parallel mode can be set from the .coveragerc file.
Diffstat (limited to 'coverage/data.py')
-rw-r--r-- | coverage/data.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/coverage/data.py b/coverage/data.py index f9d0edb..9359af1 100644 --- a/coverage/data.py +++ b/coverage/data.py @@ -34,7 +34,8 @@ class CoverageData(object): `suffix` is a suffix to append to the base file name. This can be used for multiple or parallel execution, so that many coverage data files - can exist simultaneously. + can exist simultaneously. A dot will be used to join the base name and + the suffix. `collector` is a string describing the coverage measurement software. @@ -47,7 +48,7 @@ class CoverageData(object): # ever do any file storage. self.filename = basename or ".coverage" if suffix: - self.filename += suffix + self.filename += "." + suffix self.filename = os.path.abspath(self.filename) # A map from canonical Python source file name to a dictionary in @@ -168,12 +169,13 @@ class CoverageData(object): """Combine a number of data files together. Treat `self.filename` as a file prefix, and combine the data from all - of the data files starting with that prefix. + of the data files starting with that prefix plus a dot. """ data_dir, local = os.path.split(self.filename) + localdot = local + '.' for f in os.listdir(data_dir or '.'): - if f.startswith(local): + if f.startswith(localdot): full_path = os.path.join(data_dir, f) new_lines, new_arcs = self._read_file(full_path) for filename, file_data in new_lines.items(): |