summaryrefslogtreecommitdiff
path: root/coverage/data.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-01-03 10:23:06 -0500
committerNed Batchelder <ned@nedbatchelder.com>2010-01-03 10:23:06 -0500
commit2fd7773780de939169ca4ae8ad347f92785cd112 (patch)
tree24391041799b3d7e55b5cb1a60edfc9ee6cf9f08 /coverage/data.py
parentf34cffd56572c46015615d4e541c600fde6c5af4 (diff)
downloadpython-coveragepy-git-2fd7773780de939169ca4ae8ad347f92785cd112.tar.gz
Parallel mode can be set from the .coveragerc file.
Diffstat (limited to 'coverage/data.py')
-rw-r--r--coverage/data.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/coverage/data.py b/coverage/data.py
index f9d0edbd..9359af12 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():