diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2010-03-06 12:27:50 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2010-03-06 12:27:50 -0500 |
commit | 9571a2d5913761b97f945282c5f570c9f047dbcb (patch) | |
tree | b9e9d138fc980f52f0aedafe19b66329e9a28cee /coverage/control.py | |
parent | 7c404dae7e4e45bdaa3c93ba459945f8ae2b7654 (diff) | |
download | python-coveragepy-9571a2d5913761b97f945282c5f570c9f047dbcb.tar.gz |
Don't let parallel=True prevent reporting. Fixes #49.
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/coverage/control.py b/coverage/control.py index b8b049e..1456178 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -105,9 +105,10 @@ class coverage(object): ) else: data_suffix = None + self.run_suffix = data_suffix self.data = CoverageData( - basename=self.config.data_file, suffix=data_suffix, + basename=self.config.data_file, collector="coverage v%s" % __version__ ) @@ -190,6 +191,14 @@ class coverage(object): def start(self): """Start measuring code coverage.""" + if self.run_suffix: + # If the .coveragerc file specifies parallel=True, then we need to + # remake the data file for collection, with a suffix. + from coverage import __version__ + self.data = CoverageData( + basename=self.config.data_file, suffix=self.run_suffix, + collector="coverage v%s" % __version__ + ) if self.auto_data: self.load() # Save coverage data when Python exits. @@ -251,14 +260,6 @@ class coverage(object): current measurements. """ - # If the .coveragerc file specifies parallel=True, then self.data - # already points to a suffixed data file. This won't be right for - # combining, so make a new self.data with no suffix. - from coverage import __version__ - self.data = CoverageData( - basename=self.config.data_file, - collector="coverage v%s" % __version__ - ) self.data.combine_parallel_data() def _harvest_data(self): |