diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2018-08-12 07:05:33 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-08-12 07:05:33 -0400 |
commit | 5997b823da8d60d909e776424d4ba488bb3927ec (patch) | |
tree | efb855fbb15f4bcad3515318a77e3b4a5399ea98 /coverage/data.py | |
parent | 3d6b9819921f5be15168631452053c63424fa8d8 (diff) | |
download | python-coveragepy-git-5997b823da8d60d909e776424d4ba488bb3927ec.tar.gz |
Start moving suffix to constructor
Diffstat (limited to 'coverage/data.py')
-rw-r--r-- | coverage/data.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/coverage/data.py b/coverage/data.py index 4b8b7eb2..15d0a273 100644 --- a/coverage/data.py +++ b/coverage/data.py @@ -112,7 +112,7 @@ class CoverageJsonData(object): # line data is easily recovered from the arcs: it is all the first elements # of the pairs that are greater than zero. - def __init__(self, basename=None, warn=None, debug=None): + def __init__(self, basename=None, suffix=None, warn=None, debug=None): """Create a CoverageData. `warn` is the warning function to use. @@ -125,6 +125,7 @@ class CoverageJsonData(object): self._warn = warn self._debug = debug self.filename = os.path.abspath(basename or ".coverage") + self.suffix = suffix # A map from canonical Python source file name to a dictionary in # which there's an entry for each line number that has been @@ -434,7 +435,7 @@ class CoverageJsonData(object): self._validate() - def write(self, suffix=None): + def write(self): """Write the collected coverage data to a file. `suffix` is a suffix to append to the base file name. This can be used @@ -444,6 +445,7 @@ class CoverageJsonData(object): """ filename = self.filename + suffix = self.suffix if suffix is True: # If data_suffix was a simple true value, then make a suffix with # plenty of distinguishing information. We do this here in |